<?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>Martin Falatic’s Techno Blog &#187; Martin Falatic</title>
	<atom:link href="http://www.falatic.com/index.php/author/Marty/feed" rel="self" type="application/rss+xml" />
	<link>http://www.falatic.com</link>
	<description>Technobabble...</description>
	<lastBuildDate>Thu, 20 Oct 2011 05:26:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Thoughts on mobile app crash detection and recovery</title>
		<link>http://www.falatic.com/index.php/51/thoughts-on-mobile-app-crash-detection-and-recovery</link>
		<comments>http://www.falatic.com/index.php/51/thoughts-on-mobile-app-crash-detection-and-recovery#comments</comments>
		<pubDate>Thu, 20 Oct 2011 05:26:54 +0000</pubDate>
		<dc:creator>Martin Falatic</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[quality]]></category>
		<category><![CDATA[recovery]]></category>

		<guid isPermaLink="false">http://www.falatic.com/?p=51</guid>
		<description><![CDATA[As I work on updates to my app, I&#8217;m happy to see it&#8217;s working quite well. However, inevitably there will be some boundary case that causes an exception, and as I add features (and more importantly, persistent settings) an addition &#8230; <a class="more-link" href="http://www.falatic.com/index.php/51/thoughts-on-mobile-app-crash-detection-and-recovery">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">As I work on updates to my app, I&#8217;m happy to see it&#8217;s working quite well. However, inevitably there will be some boundary case that causes an exception, and as I add features (and more importantly, persistent settings) an addition risk comes into play: failed restarts after a crash.</p>
<p><span id="more-51"></span><br />
Unlike a desktop app, where one could add a &#8220;safe mode&#8221; icon for such instances, there are few options in the mobile space. These include:</p>
<ul>
<li>Letting the user delete the application data manually via the Settings menu</li>
<li>Automatically resetting to defaults after a crash</li>
<li>Attempting to automatically work around the broken area</li>
<li>Asking the user on restart if they want to reset to defaults</li>
<li>Falling back to the last known-good configuration</li>
</ul>
<p>It&#8217;s one thing to <em>be</em> a power user, but another to be <em>forced</em> to become one thus the first option isn&#8217;t really practical. The second option guarantees recovery but may degrade the user experience (especially if there are lots of settings involved)&#8230; it should be a last resort, and a user choice. The third option is nice, but can become quite complex: this works best if settings are checkpointed frequently, but such frequent saves to flash memory are not usually a great idea. In addition, the more complex the fail-safe, the more likely it may cause a triggering exception.</p>
<p>Asking the user first is an important part of any solution, but it requires architecting a fail-safe startup sequence (one that is preference invariant). One can then offer the choice of a &#8220;fresh start&#8221; or the option of using a backed-up configuration, ensuring that the user has at least a chance of restoring to a previously working state with their settings intact.</p>
<p>A useful pattern for a single-instance app would be the following, using a persistent <em>IsRunning</em> flag:</p>
<ul>
<li>App launches</li>
<li>Load settings</li>
<li>Check if the <em> IsRunning</em> flag is set: if it is, then the last run exited abnormally (none of the normal exit points were hit which would&#8217;ve cleared the flag):</li>
<ul>
<li>Clear the <em>IsRunning</em> flag</li>
<li>Offer to restore from backup / defaults or attempt to continue as-is</li>
</ul>
<li>Initialize states and display initial UI presentation</li>
<li>Save the current settings with a backup name</li>
<li>Set the <em>IsRunning</em> flag</li>
<li>Save the settings normally</li>
<li>On normal app exit / backgrounding, clear the <em>IsRunning</em> flag and save settings normally</li>
</ul>
<p>There are other things you can do, including instrumenting for crash data collection and presenting the user an option to forward that data (anonymized!) to you for analysis.</p>
<p><strong>Software quality is as much about how well you avoid defects in the first place as it is about how gracefully you recover from them!<sup>†</sup></strong> Mistakes happen, especially in apps with complex GUIs. Errors should be as rare as possible, but when errors occur it&#8217;s the unrecoverable ones that lead to lost users. Solid error handling and recovery goes a long way towards satisfied users who stick around for the release that irons out the bug they encountered and worked around</p>
<p><strong><sup>†</sup></strong><em>This is a critical difference between hardware and software quality, especially for smaller shops. If you ship a physically defective device, the typical recourse is a return for repair or replacement &#8211; a costly proposition in terms of logistics as well as reworked hardware / waste. The quality patterns for software and hardware have commonalities but are generally quite different in practice: in general, hardware is by its very nature </em>far<em> more costly and less forgiving of quality failures. This is why popular hardware quality initiatives tend to translate poorly to the software space.</em></p>
<p><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F51%2Fthoughts-on-mobile-app-crash-detection-and-recovery&amp;linkname=Thoughts%20on%20mobile%20app%20crash%20detection%20and%20recovery" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F51%2Fthoughts-on-mobile-app-crash-detection-and-recovery&amp;linkname=Thoughts%20on%20mobile%20app%20crash%20detection%20and%20recovery" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F51%2Fthoughts-on-mobile-app-crash-detection-and-recovery&amp;linkname=Thoughts%20on%20mobile%20app%20crash%20detection%20and%20recovery" title="Tumblr" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_slashdot" href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F51%2Fthoughts-on-mobile-app-crash-detection-and-recovery&amp;linkname=Thoughts%20on%20mobile%20app%20crash%20detection%20and%20recovery" title="Slashdot" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F51%2Fthoughts-on-mobile-app-crash-detection-and-recovery&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F51%2Fthoughts-on-mobile-app-crash-detection-and-recovery&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F51%2Fthoughts-on-mobile-app-crash-detection-and-recovery&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F51%2Fthoughts-on-mobile-app-crash-detection-and-recovery&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F51%2Fthoughts-on-mobile-app-crash-detection-and-recovery&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F51%2Fthoughts-on-mobile-app-crash-detection-and-recovery&amp;count=horizontal&amp;text=Thoughts%20on%20mobile%20app%20crash%20detection%20and%20recovery" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F51%2Fthoughts-on-mobile-app-crash-detection-and-recovery&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F51%2Fthoughts-on-mobile-app-crash-detection-and-recovery&amp;count=horizontal&amp;text=Thoughts%20on%20mobile%20app%20crash%20detection%20and%20recovery" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F51%2Fthoughts-on-mobile-app-crash-detection-and-recovery&amp;title=Thoughts%20on%20mobile%20app%20crash%20detection%20and%20recovery" id="wpa2a_2"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.falatic.com/index.php/51/thoughts-on-mobile-app-crash-detection-and-recovery/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android, Honeycomb and the missing menu button&#8230;</title>
		<link>http://www.falatic.com/index.php/48/android-honeycomb-and-the-missing-menu-button</link>
		<comments>http://www.falatic.com/index.php/48/android-honeycomb-and-the-missing-menu-button#comments</comments>
		<pubDate>Wed, 12 Oct 2011 15:59:01 +0000</pubDate>
		<dc:creator>Martin Falatic</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[action bar]]></category>
		<category><![CDATA[Honeycomb]]></category>
		<category><![CDATA[menu]]></category>

		<guid isPermaLink="false">http://www.falatic.com/?p=48</guid>
		<description><![CDATA[I&#8217;ve been giving some thought to the loss of the menu button (replaced &#8211; in a way &#8211; by the action bar) in Honeycomb lately and I have to say it&#8217;s a damned peculiar choice. The argument is that by &#8230; <a class="more-link" href="http://www.falatic.com/index.php/48/android-honeycomb-and-the-missing-menu-button">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been giving some thought to the loss of the menu button (replaced &#8211; in a way &#8211; by the action bar) in Honeycomb lately and I have to say it&#8217;s a damned peculiar choice. The argument is that by unifying the UI on Honeycomb fragmentation will be reduced, but for full-screen apps, taking away the menu button on API 11+ builds, from the region of the screen that cannot be hidden, <em>fosters</em> UI fragmentation.</p>
<p><span id="more-48"></span></p>
<p>Consider apps that are meant to be full-screen, and may be deeply interactive (such as a game). Having the action bar onscreen is not tenable, so one hides it. Whereas before you could use the menu button in the gutter (where &#8220;home&#8221; and &#8220;back&#8221; reside and indeed where &#8220;menu&#8221; appears &#8211; only for legacy apps), now you must either code your own button or invent a unique (<em>but intuitive!</em>) gesture to accomplish the end result of opening a custom menu or showing the action bar. If that&#8217;s not UI fragmentation I don&#8217;t know what is!</p>
<p>Though I find the action bar awkwardly placed and non-intuitive for in-app interactions, I understand the merit of having a unified UI. What I find fault with is the shortsighted decision to effectively remove an important <em>hard</em> button from Android (does <em>anyone</em> miss the &#8220;search&#8221; button?)</p>
<p>Now we have only two guaranteed (not hideable) buttons left, for the purpose of app navigation: &#8220;back&#8221; and &#8220;home&#8221; &#8211; along with a third new button for fast task switching (which is a little redundant&#8230; long-press on the home button could easily have the same effect without adding buttons). In addition (and likely for the foreseeable future) we have a &#8220;menu&#8221; button that only appears for legacy apps (thus that space in the toolbar is already &#8220;reserved&#8221; and will remain so for quite some time).</p>
<p>It&#8217;s too bad&#8230; there&#8217;s a strong argument for always having a &#8220;menu&#8221; button handy in an always-visible place. Maybe it unhides your action bar, or maybe it opens a custom menu, but removing it doesn&#8217;t help matters: it simply encourages a new kind of fragmentation for apps that don&#8217;t need an action bar onscreen normally. Now, instead of having a consistent way to perform that &#8220;open menu&#8221; action everyone gets to do it their own way (or leave the action bar open full-time, which significantly detracts from some apps).</p>
<p>One of many things that I <em>like</em> about Android is that the basic controls (home, menu, back) are intuitive and reasonable, balancing function with minimalism. Contrast this with the one overloaded hard button in another popular OS: much like a one-button mouse, oversimplification leads to confusion, reduced functionality and a fragmented UI as everyone works around the limitation differently according to their app&#8217;s design.</p>
<p><strong>The rationale for taking away the menu button &#8211; one of the three main &#8220;always-visible&#8221; navigation and control buttons for Android up to now &#8211; defies logic: it fails at reducing fragmentation and funnels developers (and thus users) into an awkward, one-size-fits-all paradigm that is the antithesis of Android. This loss of a &#8220;hard&#8221; menu button is an unwelcome reduction in basic functionality in an apparent nod to the oversimplification of other OSes. I don&#8217;t find fault with the existence of the action bar, but removing the dedicated menu button from the always-visible area of the screen was IMHO extremely shortsighted. Now, instead of having a convenient way to reveal a hidden action bar, one must figure out how to do this for each app that normally hides its action bar. All this for the sake of removing a button that appears anyway for legacy apps.<br />
</strong></p>
<p><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F48%2Fandroid-honeycomb-and-the-missing-menu-button&amp;linkname=Android%2C%20Honeycomb%20and%20the%20missing%20menu%20button%26%238230%3B" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F48%2Fandroid-honeycomb-and-the-missing-menu-button&amp;linkname=Android%2C%20Honeycomb%20and%20the%20missing%20menu%20button%26%238230%3B" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F48%2Fandroid-honeycomb-and-the-missing-menu-button&amp;linkname=Android%2C%20Honeycomb%20and%20the%20missing%20menu%20button%26%238230%3B" title="Tumblr" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_slashdot" href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F48%2Fandroid-honeycomb-and-the-missing-menu-button&amp;linkname=Android%2C%20Honeycomb%20and%20the%20missing%20menu%20button%26%238230%3B" title="Slashdot" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F48%2Fandroid-honeycomb-and-the-missing-menu-button&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F48%2Fandroid-honeycomb-and-the-missing-menu-button&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F48%2Fandroid-honeycomb-and-the-missing-menu-button&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F48%2Fandroid-honeycomb-and-the-missing-menu-button&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F48%2Fandroid-honeycomb-and-the-missing-menu-button&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F48%2Fandroid-honeycomb-and-the-missing-menu-button&amp;count=horizontal&amp;text=Android%2C%20Honeycomb%20and%20the%20missing%20menu%20button%26%238230%3B" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F48%2Fandroid-honeycomb-and-the-missing-menu-button&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F48%2Fandroid-honeycomb-and-the-missing-menu-button&amp;count=horizontal&amp;text=Android%2C%20Honeycomb%20and%20the%20missing%20menu%20button%26%238230%3B" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F48%2Fandroid-honeycomb-and-the-missing-menu-button&amp;title=Android%2C%20Honeycomb%20and%20the%20missing%20menu%20button%26%238230%3B" id="wpa2a_4"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.falatic.com/index.php/48/android-honeycomb-and-the-missing-menu-button/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building the Android emulator for Windows</title>
		<link>http://www.falatic.com/index.php/43/building-the-android-emulator-for-windows</link>
		<comments>http://www.falatic.com/index.php/43/building-the-android-emulator-for-windows#comments</comments>
		<pubDate>Sun, 25 Sep 2011 10:23:13 +0000</pubDate>
		<dc:creator>Martin Falatic</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[Cygwin]]></category>
		<category><![CDATA[emulator]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[MinGW]]></category>
		<category><![CDATA[qemu]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.falatic.com/?p=43</guid>
		<description><![CDATA[Today I&#8217;ve been investigating an argument parsing bug in Android&#8217;s emulator on Windows (a bug that may affect all platforms). The version I&#8217;m seeing the bug was in the Android SDK r12 version of the emulator [Yep, r13's out - &#8230; <a class="more-link" href="http://www.falatic.com/index.php/43/building-the-android-emulator-for-windows">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;ve been investigating an argument parsing bug in Android&#8217;s emulator on Windows (a bug that <em>may</em> affect all platforms). The version I&#8217;m seeing the bug was in the Android SDK r12 version of the emulator [Yep, r13's out - see note below.]</p>
<p>As part of this, I needed to rebuild the emulator. It was not as straightforward as I&#8217;d hoped so I decided to write up a little howto here in case others decide to try rebuilding it on Windows. It&#8217;s really not hard at all once you install a few prerequisites! [Note: You'll also find info here about building this via Linux.]</p>
<p><span id="more-43"></span></p>
<p><em>[<strong>Edit:</strong> As of this post the HEAD is 6e2f62...599648 <em>for platform_external_qemu</em>. While this post-r12 work WILL build in Windows with these procedures, I just found out that the older r12 code (tagged as </em>android-sdk-tools_r12<em>) will NOT build in Windows! You'd need to do r12-based builds in Linux with MinGW installed. It's interesting to see just how much was fixed since SDK r12... including, evidently, the very issue I discovered today! <del>Hopefully SDK r13 gets released soon.</del> Oh look, it's out! Interestingly, unlike r12 there is no corresponding r13 tag for this one... which is part of why I didn't notice it in the Git log (I saw the tools_r13 branch though there are lots of changes after that).]</em></p>
<p><span style="text-decoration: underline;"><strong>Note:</strong></span> If you choose other install dirs, adjust the values below accordingly!</p>
<p><strong>Install Python 2.6 or 2.7:</strong></p>
<ul>
<li>I used ActivePython 2.7.2.5 x64 (x86 should be equally good)</li>
<li>Download: <a href="http://www.activestate.com/activepython/downloads" target="_blank">http://www.activestate.com/activepython/downloads</a></li>
<li>Default bin dir for Python = C:\Python27</li>
</ul>
<p><strong>Install MinGW (it includes msys now):</strong></p>
<ul>
<li>Information: <a href="http://www.mingw.org/wiki/MinGW" target="_blank">http://www.mingw.org/wiki/MinGW</a></li>
<li>Download: <a href="http://sourceforge.net/projects/mingw/" target="_blank">http://sourceforge.net/projects/mingw/</a></li>
<li>Default bin dir for MinGW = C:\MinGW\bin</li>
<li>Default bin dir for msys = C:\MinGW\msys\1.0\bin</li>
</ul>
<p><strong>Install Git:</strong> I use <em>msysgit</em> because I also use (and happily recommend!) <a href="http://code.google.com/p/tortoisegit/" target="_blank">TortoiseGit 1.7.3.0</a>:</p>
<ul>
<li>Information: <a href="http://code.google.com/p/msysgit/" target="_blank">http://code.google.com/p/msysgit/</a></li>
<li>Download: <a href="http://code.google.com/p/msysgit/downloads/list" target="_blank">http://code.google.com/p/msysgit/downloads/list</a></li>
<ul>
<li>Git-1.7.4-preview20110204.exe works, 1.7.6 may as well</li>
</ul>
<li>Default bin dir for Git = C:\Git\bin</li>
</ul>
<p><strong>Open a command prompt and ensure your path is set correctly (omit duplicates as necessary, but ensure such entries weren&#8217;t eclipsed by other things you&#8217;ve installed, like Cygwin):</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
set PATH=C:\MinGW\msys\1.0\bin;C:\MinGW\bin;C:\Python27;C:\Git\bin;%PATH%
</pre>
<p><strong>Clone the repository! (Because of the kernel.org outage we&#8217;re using <a href="https://github.com/android/platform_external_qemu" target="_blank">the github mirror</a>):</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
mkdir H:\temp_repo
cd /D H:\temp_repo
git clone https://github.com/android/platform_external_qemu.git
</pre>
<p><strong>Start bash in the folder with the emulator sources (from this point on commands run at the bash prompt):</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
cd /D H:\temp_repo\platform_external_qemu
bash
</pre>
<p><strong>Setting PS1 makes the prompt more verbose than the default <em>&#8220;bash-3.1$&#8221;</em> prompt:</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
PS1='\[\e]0;\w\a\]\n\[\e[36m\]\u@\h \[\e[32m\]\w\[\e[0m\]\n\$ '
</pre>
<p><strong>There&#8217;s a small problem if you want the version string in the emulator to be fully formed:</strong></p>
<ul>
<li>In <em>Makefile.common</em>, ANDROID_BUILD_ID get set <em>only</em> if <em>BUILD_STANDALONE_EMULATOR == &#8220;&#8221;</em> &#8211; never if <em>BUILD_STANDALONE_EMULATOR == &#8216;true&#8217;</em> (which is what we&#8217;re building here). Here&#8217;s a fix for that, at least for the 13.x line of the emulator (line numbers may vary!):</li>
<ul>
<li>Broken: line 66: <em>ifeq ($(BUILD_STANDALONE_EMULATOR),)</em></li>
<li>Patched: line 66: <em>ifneq ($(BUILD_STANDALONE_EMULATOR),false)</em></li>
</ul>
<li><strong>If in doubt, ignore this tweak</strong>! Understand your -version output will not be very informative. That can quickly get annoying if you are building multiple versions&#8230;</li>
</ul>
<p><strong>Set some variables and run the build:</strong></p>
<pre class="brush: bash; light: true; title: ; notranslate">
# Customize this as desired
export ANDROID_SDK_TOOLS_REVISION=42
export ANDROID_BUILD_ID=custom

# Inserts your username and the timestamp in the build name
export MY_BUILD_TIMESTAMP=`date +%Y%m%d_%H%M%S`
export BUILD_ID=${USERNAME}
export BUILD_NUMBER=${MY_BUILD_TIMESTAMP}

# Executes the build
./android-rebuild.sh --static 2&gt;&amp;1 | \
   tee build_${USERNAME}-${MY_BUILD_TIMESTAMP}.log
</pre>
<p><strong>Check the version string of the emulator you just built:</strong></p>
<ul>
<li>Run this:</li>
<ul>
<li><em>objs/emulator.exe -version</em></li>
</ul>
<li>See output like this:</li>
<ul>
<li>Android emulator version 13.0 (build_id Marty-20110925_042430)</li>
</ul>
</ul>
<p><strong>Using the newly-built emulator:</strong></p>
<ul>
<li><strong></strong>The objects of interest in objs are:<em></em></li>
<ul>
<li><em>emulator.exe</em>, <em>emulator-arm.exe, </em><em>emulator-x86.exe</em></li>
</ul>
<li>You may need to copy them to <em>android-sdk-windows/tools</em> folder to use them (<strong>back up the originals first before replacing them!</strong>)</li>
</ul>
<p><strong>Notes on building via Linux:</strong></p>
<p style="padding-left: 30px;">As mentioned above, I managed to get all this to work on Windows just fine&#8230; technically, no source edits are necessary at this point to make it work. However, when I switched to the <em>android-sdk-tools_r12</em> tag it failed with:<em></em></p>
<p style="padding-left: 60px;"><em>cc1: error: unrecognized command line option &#8220;-mno-cygwin&#8221;</em></p>
<p style="padding-left: 30px;">Turns out this is a <a href="http://code.google.com/p/android/issues/detail?id=18949" target="_blank">known issue</a>&#8230; and in fact it was fixed in a later commit to the emulator code base! (I saw it as I was browsing the overall delta between r12 and the latest.) But, even with that fixed I couldn&#8217;t get r12 to build within Windows, so I went to Linux. I was already configured to build CyanogenMod, so everything was in place except MinGW. I installed <em>mingw32</em>, made that one fix to <em>android-rebuild.sh</em> and ran:</p>
<p style="padding-left: 60px;">./android-rebuild.sh &#8211;static &#8211;mingw</p>
<p style="padding-left: 30px;">And it worked just fine!</p>
<p style="padding-left: 30px;">(<strong>Note:</strong> the &#8211;mingw option is NOT used when building this within Windows&#8230; it&#8217;s a little confusing because of course we&#8217;re using MinGW <em>in</em> Windows, but that&#8217;s how it&#8217;s coded in their build system.)</p>
<p><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F43%2Fbuilding-the-android-emulator-for-windows&amp;linkname=Building%20the%20Android%20emulator%20for%20Windows" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F43%2Fbuilding-the-android-emulator-for-windows&amp;linkname=Building%20the%20Android%20emulator%20for%20Windows" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F43%2Fbuilding-the-android-emulator-for-windows&amp;linkname=Building%20the%20Android%20emulator%20for%20Windows" title="Tumblr" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_slashdot" href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F43%2Fbuilding-the-android-emulator-for-windows&amp;linkname=Building%20the%20Android%20emulator%20for%20Windows" title="Slashdot" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F43%2Fbuilding-the-android-emulator-for-windows&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F43%2Fbuilding-the-android-emulator-for-windows&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F43%2Fbuilding-the-android-emulator-for-windows&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F43%2Fbuilding-the-android-emulator-for-windows&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F43%2Fbuilding-the-android-emulator-for-windows&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F43%2Fbuilding-the-android-emulator-for-windows&amp;count=horizontal&amp;text=Building%20the%20Android%20emulator%20for%20Windows" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F43%2Fbuilding-the-android-emulator-for-windows&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F43%2Fbuilding-the-android-emulator-for-windows&amp;count=horizontal&amp;text=Building%20the%20Android%20emulator%20for%20Windows" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F43%2Fbuilding-the-android-emulator-for-windows&amp;title=Building%20the%20Android%20emulator%20for%20Windows" id="wpa2a_6"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.falatic.com/index.php/43/building-the-android-emulator-for-windows/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows: hybrid sleep and hibernation</title>
		<link>http://www.falatic.com/index.php/42/windows-hybrid-sleep-and-hibernation</link>
		<comments>http://www.falatic.com/index.php/42/windows-hybrid-sleep-and-hibernation#comments</comments>
		<pubDate>Thu, 08 Sep 2011 18:30:09 +0000</pubDate>
		<dc:creator>Martin Falatic</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[both]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[hybrid sleep]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.falatic.com/?p=42</guid>
		<description><![CDATA[With the latest Windows (Vista and 7) you can select &#8220;Hybrid Sleep&#8221; as a suspend mode. In essence, it provides the fast restart of your usual sleep mode with the durability of hibernation: it writes the system state to disk &#8230; <a class="more-link" href="http://www.falatic.com/index.php/42/windows-hybrid-sleep-and-hibernation">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>With the latest Windows (Vista and 7) you can select &#8220;Hybrid Sleep&#8221; as a suspend mode. In essence, it provides the fast restart of your usual sleep mode with the durability of hibernation: it writes the system state to disk like hibernate, but if the system is &#8220;warm&#8221; (versus powered off) it&#8217;ll use the data in memory when coming out of sleep. If you power down during hybrid sleep (AFTER the data has been flushed to the hibernation file) the system will reboot on power up and will restore from disk.</p>
<p>This is all nice, but when you enable hybrid sleep you lose &#8220;hibernate&#8221; as a separate option. Perhaps this is to avoid confusion (<strong>remember: </strong><em><strong>hybrid sleep performs hibernation as part of its process, it just doesn&#8217;t completely power down</strong></em>). However, there are times I&#8217;d rather have the system fully hibernate instead of just sleeping (such as if I&#8217;m going to be away a few days). Since touching the power button once it&#8217;s in full hybrid sleep often re-awakens my system (and I don&#8217;t prefer to power down directly from any sleep state), I wanted a one-click solution.</p>
<p><strong>So, </strong><strong>if you use hybrid sleep and want to explicitly hibernate, run this (even as a regular user) and your system should hibernate rather than just enter hybrid sleep:</strong></p>
<pre>%windir%\system32\rundll32.exe PowrProf.dll, SetSuspendState 0,1,0</pre>
<p>This should also work if you DON&#8217;T use hybrid sleep and DO have the hibernation option&#8230; though if you have &#8220;hibernate&#8221; as an option you&#8217;re probably not looking for this sort of fix.</p>
<p>Disclaimers: If hibernation or hybrid sleep didn&#8217;t work before this won&#8217;t <em>make</em> hibernation work (e.g., if you have insufficient disk space or have explicitly disabled hibernation and hybrid sleep)&#8230; in that case this will likely send you into the typical sleep mode. You can usually tell the difference by noting the lengthy time spend writing data to the disk, followed by a clear power off. (Hybrid sleep does the same, except it goes into sleep mode &#8211; how your computer shows this will vary).</p>
<p>More info <a href="http://www.technologyquestions.com/technology/windows-xp/208549-powrprof-dll-setsuspendstate-0-1-0-caused-hibernation.html" target="_blank">here</a>.</p>
<p>&nbsp;</p>
<p><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F42%2Fwindows-hybrid-sleep-and-hibernation&amp;linkname=Windows%3A%20hybrid%20sleep%20and%20hibernation" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F42%2Fwindows-hybrid-sleep-and-hibernation&amp;linkname=Windows%3A%20hybrid%20sleep%20and%20hibernation" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F42%2Fwindows-hybrid-sleep-and-hibernation&amp;linkname=Windows%3A%20hybrid%20sleep%20and%20hibernation" title="Tumblr" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_slashdot" href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F42%2Fwindows-hybrid-sleep-and-hibernation&amp;linkname=Windows%3A%20hybrid%20sleep%20and%20hibernation" title="Slashdot" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F42%2Fwindows-hybrid-sleep-and-hibernation&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F42%2Fwindows-hybrid-sleep-and-hibernation&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F42%2Fwindows-hybrid-sleep-and-hibernation&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F42%2Fwindows-hybrid-sleep-and-hibernation&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F42%2Fwindows-hybrid-sleep-and-hibernation&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F42%2Fwindows-hybrid-sleep-and-hibernation&amp;count=horizontal&amp;text=Windows%3A%20hybrid%20sleep%20and%20hibernation" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F42%2Fwindows-hybrid-sleep-and-hibernation&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F42%2Fwindows-hybrid-sleep-and-hibernation&amp;count=horizontal&amp;text=Windows%3A%20hybrid%20sleep%20and%20hibernation" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F42%2Fwindows-hybrid-sleep-and-hibernation&amp;title=Windows%3A%20hybrid%20sleep%20and%20hibernation" id="wpa2a_8"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.falatic.com/index.php/42/windows-hybrid-sleep-and-hibernation/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pinging with Python</title>
		<link>http://www.falatic.com/index.php/39/pinging-with-python</link>
		<comments>http://www.falatic.com/index.php/39/pinging-with-python#comments</comments>
		<pubDate>Tue, 06 Sep 2011 13:47:16 +0000</pubDate>
		<dc:creator>Martin Falatic</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Cygwin]]></category>
		<category><![CDATA[ICMP]]></category>
		<category><![CDATA[IP]]></category>
		<category><![CDATA[ping]]></category>
		<category><![CDATA[Python 3]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.falatic.com/?p=39</guid>
		<description><![CDATA[2011-10-12 update: Brought in more changes from Jens Diemer&#8217;s new repository for the Python 2 version of this project. 2011-09-12 update: The version here is for Python 3.x as described below. Jens Diemer posted an updated version of this to &#8230; <a class="more-link" href="http://www.falatic.com/index.php/39/pinging-with-python">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><em>2011-10-12 update: Brought in more changes from <a href="https://github.com/jedie/python-ping" target="_blank">Jens Diemer&#8217;s new repository for the Python 2 version of this project</a>.<br />
</em></p>
<p><em>2011-09-12 update: The version here is for Python 3.x as described below. <a href="https://github.com/jedie/python-code-snippets/blob/master/CodeSnippets/ping.py" target="_blank">Jens Diemer posted an updated version of this to GitHub</a> with corrections. It&#8217;s mainly a backport of this script to Python 2.x along with some cosmetic changes (and yes, I do like delimiting functions and such with comment lines &#8211; it makes code blocks far easier to distinguish, even in indentation-intensive Python). He added a bugfix to handle SIGBREAK better, which I&#8217;ve pulled into the code below.<br />
</em></p>
<p>A while back, when I decided to learn Python, I looked into writing my own sort of ping utility with it. Then I learned just how ridiculously arduous it is to perform this seemingly-simple function (essentially, you have to be running as root in Unix (or Administrator in Windows) to accomplish this, and generally speaking running scripts like this as root is considered bad form). But it can be done&#8230;</p>
<p><span id="more-39"></span></p>
<p>This intrigued me as a pet project but I moved on to other things, eventually picking up Python along the way (I&#8217;ve focused on Python 3.x since the Unicode handling is FAR better than it is in 2.7, not to mention its other improvements).</p>
<p>Recently, I decided to revisit the &#8220;ping with Python&#8221; idea, and searched around to see if anyone else had tackled it. Sure enough, <a href="http://www.g-loaded.eu/2009/10/30/python-ping/" target="_blank">I found George Notaras&#8217; site</a> which has a very nice implementation in 2.x as well as a recent commenter who created a 3.x port. Only problem was, the HTML is mangled there so neither script worked. As I delved into it, I managed to get the scripts working, and then decided to go the extra mile and make some enhancements and improvements. Along the way I ended up getting the source for ping (via Cygwin) and building it from scratch as well (particularly to understand the checksum routine, and for other hints in general).</p>
<p>It was rather pleasing to not only get this working but to make it work far better in terms of functionality and robustness, all the while reinforcing and extending my understanding of Python.</p>
<p>Note: The original C source for &#8220;ping&#8221; can be found <a href="http://ping127001.com/pingpage.htm" target="_blank">here</a> (you&#8217;ll need to extract it from ping.shar). Or just search for ping.c&#8230; for example, I found an identical copy of ping.c <a href="http://ws.edu.isoc.org/materials/src/ping.c" target="_blank">here</a>.</p>
<pre class="brush: python; title: ; notranslate">
#!/usr/bin/env python
# -*- coding: utf-8 -*-

&quot;&quot;&quot;
    A pure python ping implementation using raw sockets.

    (This is Python 3 port of https://github.com/jedie/python-ping)

    Note that ICMP messages can only be sent from processes running as root
    (in Windows, you must run this script as 'Administrator').

    Derived from ping.c distributed in Linux's netkit. That code is
    copyright (c) 1989 by The Regents of the University of California.
    That code is in turn derived from code written by Mike Muuss of the
    US Army Ballistic Research Laboratory in December, 1983 and
    placed in the public domain. They have my thanks.

    Bugs are naturally mine. I'd be glad to hear about them. There are
    certainly word - size dependencies here.

    Copyright (c) Matthew Dixon Cowles, &lt;http://www.visi.com/~mdc/&gt;.
    Distributable under the terms of the GNU General Public License
    version 2. Provided with no warranties of any sort.

    Original Version from Matthew Dixon Cowles:
      -&gt; ftp://ftp.visi.com/users/mdc/ping.py

    Rewrite by Jens Diemer:
      -&gt; http://www.python-forum.de/post-69122.html#69122

    Rewrite by George Notaras:
      -&gt; http://www.g-loaded.eu/2009/10/30/python-ping/

    Enhancements by Martin Falatic:
      -&gt; http://www.falatic.com/index.php/39/pinging-with-python

    Revision history
    ~~~~~~~~~~~~~~~~

    October 12, 2011
    --------------
    Merged updates from the main project
      -&gt; https://github.com/jedie/python-ping

    September 12, 2011
    --------------
    Bugfixes + cleanup by Jens Diemer
    Tested with Ubuntu + Windows 7

    September 6, 2011
    --------------
    Cleanup by Martin Falatic. Restored lost comments and docs. Improved
    functionality: constant time between pings, internal times consistently
    use milliseconds. Clarified annotations (e.g., in the checksum routine).
    Using unsigned data in IP &amp; ICMP header pack/unpack unless otherwise
    necessary. Signal handling. Ping-style output formatting and stats.

    August 3, 2011
    --------------
    Ported to py3k by Zach Ware. Mostly done by 2to3; also minor changes to
    deal with bytes vs. string changes (no more ord() in checksum() because
    &gt;source_string&lt; is actually bytes, added .encode() to data in
    send_one_ping()).  That's about it.

    March 11, 2010
    --------------
    changes by Samuel Stauffer:
    - replaced time.clock with default_timer which is set to
      time.clock on windows and time.time on other systems.

    November 8, 2009
    ----------------
    Improved compatibility with GNU/Linux systems.

    Fixes by:
     * George Notaras -- http://www.g-loaded.eu
    Reported by:
     * Chris Hallman -- http://cdhallman.blogspot.com

    Changes in this release:
     - Re-use time.time() instead of time.clock(). The 2007 implementation
       worked only under Microsoft Windows. Failed on GNU/Linux.
       time.clock() behaves differently under the two OSes[1].

    [1] http://docs.python.org/library/time.html#time.clock

    May 30, 2007
    ------------
    little rewrite by Jens Diemer:
     -  change socket asterisk import to a normal import
     -  replace time.time() with time.clock()
     -  delete &quot;return None&quot; (or change to &quot;return&quot; only)
     -  in checksum() rename &quot;str&quot; to &quot;source_string&quot;

    December 4, 2000
    ----------------
    Changed the struct.pack() calls to pack the checksum and ID as
    unsigned. My thanks to Jerome Poincheval for the fix.

    November 22, 1997
    -----------------
    Initial hack. Doesn't do much, but rather than try to guess
    what features I (or others) will want in the future, I've only
    put in what I need now.

    December 16, 1997
    -----------------
    For some reason, the checksum bytes are in the wrong order when
    this is run under Solaris 2.X for SPARC but it works right under
    Linux x86. Since I don't know just what's wrong, I'll swap the
    bytes always and then do an htons().

    ===========================================================================
    IP header info from RFC791
      -&gt; http://tools.ietf.org/html/rfc791)

    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |Version|  IHL  |Type of Service|          Total Length         |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |         Identification        |Flags|      Fragment Offset    |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |  Time to Live |    Protocol   |         Header Checksum       |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                       Source Address                          |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                    Destination Address                        |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    |                    Options                    |    Padding    |
    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

    ===========================================================================
    ICMP Echo / Echo Reply Message header info from RFC792
      -&gt; http://tools.ietf.org/html/rfc792

        0                   1                   2                   3
        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        |     Type      |     Code      |          Checksum             |
        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        |           Identifier          |        Sequence Number        |
        +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
        |     Data ...
        +-+-+-+-+-

    ===========================================================================
    ICMP parameter info:
      -&gt; http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xml

    ===========================================================================
    An example of ping's typical output:

    PING heise.de (193.99.144.80): 56 data bytes
    64 bytes from 193.99.144.80: icmp_seq=0 ttl=240 time=127 ms
    64 bytes from 193.99.144.80: icmp_seq=1 ttl=240 time=127 ms
    64 bytes from 193.99.144.80: icmp_seq=2 ttl=240 time=126 ms
    64 bytes from 193.99.144.80: icmp_seq=3 ttl=240 time=126 ms
    64 bytes from 193.99.144.80: icmp_seq=4 ttl=240 time=127 ms

    ----heise.de PING Statistics----
    5 packets transmitted, 5 packets received, 0.0% packet loss
    round-trip (ms)  min/avg/max/med = 126/127/127/127

    ===========================================================================
&quot;&quot;&quot;

#=============================================================================#
import os, sys, socket, struct, select, time, signal

if sys.platform == &quot;win32&quot;:
    # On Windows, the best timer is time.clock()
    default_timer = time.clock
else:
    # On most other platforms the best timer is time.time()
    default_timer = time.time

#=============================================================================#
# ICMP parameters

ICMP_ECHOREPLY  =    0 # Echo reply (per RFC792)
ICMP_ECHO       =    8 # Echo request (per RFC792)
ICMP_MAX_RECV   = 2048 # Max size of incoming buffer

MAX_SLEEP = 1000

class MyStats:
    thisIP   = &quot;0.0.0.0&quot;
    pktsSent = 0
    pktsRcvd = 0
    minTime  = 999999999
    maxTime  = 0
    totTime  = 0
    fracLoss = 1.0

myStats = MyStats # Used globally

#=============================================================================#
def checksum(source_string):
    &quot;&quot;&quot;
    A port of the functionality of in_cksum() from ping.c
    Ideally this would act on the string as a series of 16-bit ints (host
    packed), but this works.
    Network data is big-endian, hosts are typically little-endian
    &quot;&quot;&quot;
    countTo = (int(len(source_string)/2))*2
    sum = 0
    count = 0

    # Handle bytes in pairs (decoding as short ints)
    loByte = 0
    hiByte = 0
    while count &lt; countTo:
        if (sys.byteorder == &quot;little&quot;):
            loByte = source_string[count]
            hiByte = source_string[count + 1]
        else:
            loByte = source_string[count + 1]
            hiByte = source_string[count]
        sum = sum + (hiByte * 256 + loByte)
        count += 2

    # Handle last byte if applicable (odd-number of bytes)
    # Endianness should be irrelevant in this case
    if countTo &lt; len(source_string): # Check for odd length
        loByte = source_string[len(source_string)-1]
        sum += loByte

    sum &amp;= 0xffffffff # Truncate sum to 32 bits (a variance from ping.c, which
                      # uses signed ints, but overflow is unlikely in ping)

    sum = (sum &gt;&gt; 16) + (sum &amp; 0xffff)    # Add high 16 bits to low 16 bits
    sum += (sum &gt;&gt; 16)                    # Add carry from above (if any)
    answer = ~sum &amp; 0xffff              # Invert and truncate to 16 bits
    answer = socket.htons(answer)

    return answer

#=============================================================================#
def do_one(destIP, timeout, mySeqNumber, numDataBytes):
    &quot;&quot;&quot;
    Returns either the delay (in ms) or None on timeout.
    &quot;&quot;&quot;
    global myStats

    delay = None

    try: # One could use UDP here, but it's obscure
        mySocket = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.getprotobyname(&quot;icmp&quot;))
    except socket.error as e:
        print(&quot;failed. (socket error: '%s')&quot; % e.args[1])
        raise # raise the original error

    my_ID = os.getpid() &amp; 0xFFFF

    sentTime = send_one_ping(mySocket, destIP, my_ID, mySeqNumber, numDataBytes)
    if sentTime == None:
        mySocket.close()
        return delay

    myStats.pktsSent += 1;

    recvTime, dataSize, iphSrcIP, icmpSeqNumber, iphTTL = receive_one_ping(mySocket, my_ID, timeout)

    mySocket.close()

    if recvTime:
        delay = (recvTime-sentTime)*1000
        print(&quot;%d bytes from %s: icmp_seq=%d ttl=%d time=%d ms&quot; % (
            dataSize, socket.inet_ntoa(struct.pack(&quot;!I&quot;, iphSrcIP)), icmpSeqNumber, iphTTL, delay)
        )
        myStats.pktsRcvd += 1;
        myStats.totTime += delay
        if myStats.minTime &gt; delay:
            myStats.minTime = delay
        if myStats.maxTime &lt; delay:
            myStats.maxTime = delay
    else:
        delay = None
        print(&quot;Request timed out.&quot;)

    return delay

#=============================================================================#
def send_one_ping(mySocket, destIP, myID, mySeqNumber, numDataBytes):
    &quot;&quot;&quot;
    Send one ping to the given &gt;destIP&lt;.
    &quot;&quot;&quot;
    destIP  =  socket.gethostbyname(destIP)

    # Header is type (8), code (8), checksum (16), id (16), sequence (16)
    myChecksum = 0

    # Make a dummy heder with a 0 checksum.
    header = struct.pack(
        &quot;!BBHHH&quot;, ICMP_ECHO, 0, myChecksum, myID, mySeqNumber
    )

    padBytes = []
    startVal = 0x42
    for i in range(startVal, startVal + (numDataBytes)):
        padBytes += [(i &amp; 0xff)]  # Keep chars in the 0-255 range
    data = bytes(padBytes)

    # Calculate the checksum on the data and the dummy header.
    myChecksum = checksum(header + data) # Checksum is in network order

    # Now that we have the right checksum, we put that in. It's just easier
    # to make up a new header than to stuff it into the dummy.
    header = struct.pack(
        &quot;!BBHHH&quot;, ICMP_ECHO, 0, myChecksum, myID, mySeqNumber
    )

    packet = header + data

    sendTime = time.time()

    try:
        mySocket.sendto(packet, (destIP, 1)) # Port number is irrelevant for ICMP
    except socket.error as e:
        print(&quot;General failure (%s)&quot; % (e.args[1]))
        return

    return sendTime

#=============================================================================#
def receive_one_ping(mySocket, myID, timeout):
    &quot;&quot;&quot;
    Receive the ping from the socket. Timeout = in ms
    &quot;&quot;&quot;
    timeLeft = timeout/1000

    while True: # Loop while waiting for packet or timeout
        startedSelect = time.time()
        whatReady = select.select([mySocket], [], [], timeLeft)
        howLongInSelect = (time.time() - startedSelect)
        if whatReady[0] == []: # Timeout
            return None, 0, 0, 0, 0

        timeReceived = time.time()

        recPacket, addr = mySocket.recvfrom(ICMP_MAX_RECV)

        ipHeader = recPacket[:20]
        iphVersion, iphTypeOfSvc, iphLength, \
        iphID, iphFlags, iphTTL, iphProtocol, \
        iphChecksum, iphSrcIP, iphDestIP = struct.unpack(
            &quot;!BBHHHBBHII&quot;, ipHeader
        )

        icmpHeader = recPacket[20:28]
        icmpType, icmpCode, icmpChecksum, \
        icmpPacketID, icmpSeqNumber = struct.unpack(
            &quot;!BBHHH&quot;, icmpHeader
        )

        if icmpPacketID == myID: # Our packet
            dataSize = len(recPacket) - 28
            return timeReceived, dataSize, iphSrcIP, icmpSeqNumber, iphTTL

        timeLeft = timeLeft - howLongInSelect
        if timeLeft &lt;= 0:
            return None, 0, 0, 0, 0

#=============================================================================#
def dump_stats():
    &quot;&quot;&quot;
    Show stats when pings are done
    &quot;&quot;&quot;
    global myStats

    print(&quot;\n----%s PYTHON PING Statistics----&quot; % (myStats.thisIP))

    if myStats.pktsSent &gt; 0:
        myStats.fracLoss = (myStats.pktsSent - myStats.pktsRcvd)/myStats.pktsSent

    print(&quot;%d packets transmitted, %d packets received, %0.1f%% packet loss&quot; % (
        myStats.pktsSent, myStats.pktsRcvd, 100.0 * myStats.fracLoss
    ))

    if myStats.pktsRcvd &gt; 0:
        print(&quot;round-trip (ms)  min/avg/max = %d/%0.1f/%d&quot; % (
            myStats.minTime, myStats.totTime/myStats.pktsRcvd, myStats.maxTime
        ))

    print()
    return

#=============================================================================#
def signal_handler(signum, frame):
    &quot;&quot;&quot;
    Handle exit via signals
    &quot;&quot;&quot;
    dump_stats()
    print(&quot;\n(Terminated with signal %d)\n&quot; % (signum))
    sys.exit(0)

#=============================================================================#
def verbose_ping(hostname, timeout = 1000, count = 3, numDataBytes = 55):
    &quot;&quot;&quot;
    Send &gt;count&lt; ping to &gt;destIP&lt; with the given &gt;timeout&lt; and display
    the result.
    &quot;&quot;&quot;
    global myStats

    signal.signal(signal.SIGINT, signal_handler)   # Handle Ctrl-C
    if hasattr(signal, &quot;SIGBREAK&quot;):
        # Handle Ctrl-Break e.g. under Windows
        signal.signal(signal.SIGBREAK, signal_handler)

    myStats = MyStats() # Reset the stats

    mySeqNumber = 0 # Starting value

    try:
        destIP = socket.gethostbyname(hostname)
        print(&quot;\nPYTHON PING %s (%s): %d data bytes&quot; % (hostname, destIP, numDataBytes))
    except socket.gaierror as e:
        print(&quot;\nPYTHON PING: Unknown host: %s (%s)&quot; % (hostname, e.args[1]))
        print()
        return

    myStats.thisIP = destIP

    for i in range(count):
        delay = do_one(destIP, timeout, mySeqNumber, numDataBytes)

        if delay == None:
            delay = 0

        mySeqNumber += 1

        # Pause for the remainder of the MAX_SLEEP period (if applicable)
        if (MAX_SLEEP &gt; delay):
            time.sleep((MAX_SLEEP - delay)/1000)

    dump_stats()

#=============================================================================#
if __name__ == '__main__':

    # These should work:
    verbose_ping(&quot;heise.de&quot;)
    verbose_ping(&quot;google.com&quot;)

    # Inconsistent on Windows w/ ActivePython (Python 3.2 resolves correctly
    # to the local host, but 2.7 tries to resolve to the local *gateway*)
    verbose_ping(&quot;localhost&quot;)

    # Should fail with 'getaddrinfo failed':
    verbose_ping(&quot;foobar_url.foobar&quot;)

    # Should fail (timeout), but it depends on the local network:
    verbose_ping(&quot;192.168.255.254&quot;)

    # Should fails with 'The requested address is not valid in its context':
    verbose_ping(&quot;0.0.0.0&quot;)

#=============================================================================#
</pre>
<p><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F39%2Fpinging-with-python&amp;linkname=Pinging%20with%20Python" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F39%2Fpinging-with-python&amp;linkname=Pinging%20with%20Python" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F39%2Fpinging-with-python&amp;linkname=Pinging%20with%20Python" title="Tumblr" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_slashdot" href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F39%2Fpinging-with-python&amp;linkname=Pinging%20with%20Python" title="Slashdot" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F39%2Fpinging-with-python&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F39%2Fpinging-with-python&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F39%2Fpinging-with-python&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F39%2Fpinging-with-python&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F39%2Fpinging-with-python&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F39%2Fpinging-with-python&amp;count=horizontal&amp;text=Pinging%20with%20Python" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F39%2Fpinging-with-python&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F39%2Fpinging-with-python&amp;count=horizontal&amp;text=Pinging%20with%20Python" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F39%2Fpinging-with-python&amp;title=Pinging%20with%20Python" id="wpa2a_10"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.falatic.com/index.php/39/pinging-with-python/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>New (old?) Twitter password stealer making the rounds&#8230;</title>
		<link>http://www.falatic.com/index.php/36/new-old-twitter-password-stealer-making-the-rounds</link>
		<comments>http://www.falatic.com/index.php/36/new-old-twitter-password-stealer-making-the-rounds#comments</comments>
		<pubDate>Sun, 14 Aug 2011 04:35:16 +0000</pubDate>
		<dc:creator>Martin Falatic</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[scams]]></category>
		<category><![CDATA[securiity]]></category>
		<category><![CDATA[social networking]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://www.falatic.com/?p=36</guid>
		<description><![CDATA[If you click a Twitter link and it sends you to a Twitter login page, beware&#8230; look closely at the address bar and ensure you&#8217;re actually at Twitter&#8217;s login page and not a thieving imposter&#8217;s page! Recently a friend on &#8230; <a class="more-link" href="http://www.falatic.com/index.php/36/new-old-twitter-password-stealer-making-the-rounds">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>If you click a Twitter link and it sends you to a Twitter login page, beware&#8230; look closely at the address bar and ensure you&#8217;re actually at Twitter&#8217;s login page and not a thieving imposter&#8217;s page!</strong></p>
<p><strong></strong>Recently a friend on Twitter sent a link as part of a message:</p>
<p>&#8220;<em>Look! it&#8217;s you in this picture.. [along with a tinyurl link]</em>&#8221;</p>
<p>Other variants of this exist, such as &#8220;<em>you&#8217;ll laugh when you see this pic of you</em>&#8230; <em> [along with a tinyurl link]</em>&#8220;.</p>
<p>Turns out, my friend&#8217;s account had been hijacked. (Yes, it really was a friend&#8230; I&#8217;ve seen this before with Twitter and other sites but it looks identical to an attack I saw about a month ago).</p>
<p><span id="more-36"></span>In this case, the bogus link went to a subpage on <strong>itwittiler.com</strong> (IP address 220.164.140.252), a domain registered in China - earlier today! The page <em>looks</em> like Twitter&#8217;s login page but it&#8217;s not. In fact, I sandboxed it and entered a bogus username/password to see if it&#8217;d redirect to Twitter no matter what was entered. No&#8230; it redirected me to a &#8220;StalkTrak&#8221; page, clearly malformed and totally bogus. Read <a href="http://nakedsecurity.sophos.com/2011/08/12/twitter-finally-released-a-stalkers-app-no-its-a-phishing-scam/" target="_blank">this Sophos security article</a> for more info.</p>
<p>Another subpage (found via some searching online) does redirect to Twitter, but to a user who doesn&#8217;t exist. In all cases, the first page you go to looks just like the Twitter login page (there are some subtle yet sloppy differences, but next time there might not be.)</p>
<p><strong>It&#8217;s quite likely the page is harvesting credentials along the way. If you get stung, go to the real Twitter homepage and reset your password pronto (after closing your browser windows).</strong></p>
<p>More info on <strong>itwittiler.com</strong>, via <em>whois</em>:</p>
<p>Domain Name: ITWITTILER.COM<br />
Registrar: JIANGSU BANGNING SCIENCE &amp; TECHNOLOGY CO. LTD<br />
Whois Server: whois.55hl.com<br />
Referral URL: http://www.55hl.com<br />
Name Server: DNS5.4CUN.COM<br />
Name Server: DNS6.4CUN.COM<br />
Status: ok<br />
Updated Date: 13-aug-2011<br />
Creation Date: 13-aug-2011<br />
Expiration Date: 13-aug-2012</p>
<p><strong>Update:</strong> Another StalkTrak spam domain made the rounds last month: <strong>itiwitter.com</strong>. Surprise! It&#8217;s registered to the very same registrar! Judging by the same subpage structure I strongly suspect it&#8217;s the very same scammer using the very same site (or site structure)&#8230; while the IP address won&#8217;t resolve, it turns out <a href="http://www.priceofweb.com/www.itiwitter.com" target="_blank">this site&#8217;s for sale!</a> And the IP address when last they checked? 220.164.140.252. Isn&#8217;t that special?</p>
<p>Domain Name: ITIWITTER.COM<br />
Registrar: JIANGSU BANGNING SCIENCE &amp; TECHNOLOGY CO. LTD<br />
Whois Server: whois.55hl.com<br />
Referral URL: http://www.55hl.com<br />
Name Server: DNS5.4CUN.COM<br />
Name Server: DNS6.4CUN.COM<br />
Status: clientHold<br />
Status: clientTransferProhibited<br />
Updated Date: 20-jul-2011<br />
Creation Date: 15-jul-2011<br />
Expiration Date: 15-jul-2012</p>
<p><strong>Still more information can be found <a href="http://stopmalvertising.com/spam-scams/do-not-hand-over-your-twitter-credentials-to-stalktrak.html" target="_blank">on this site</a></strong>, which talks about the same scam (back before the scammers changed domain names and came back from the &#8220;dead&#8221;).</p>
<p><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F36%2Fnew-old-twitter-password-stealer-making-the-rounds&amp;linkname=New%20%28old%3F%29%20Twitter%20password%20stealer%20making%20the%20rounds%26%238230%3B" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F36%2Fnew-old-twitter-password-stealer-making-the-rounds&amp;linkname=New%20%28old%3F%29%20Twitter%20password%20stealer%20making%20the%20rounds%26%238230%3B" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F36%2Fnew-old-twitter-password-stealer-making-the-rounds&amp;linkname=New%20%28old%3F%29%20Twitter%20password%20stealer%20making%20the%20rounds%26%238230%3B" title="Tumblr" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_slashdot" href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F36%2Fnew-old-twitter-password-stealer-making-the-rounds&amp;linkname=New%20%28old%3F%29%20Twitter%20password%20stealer%20making%20the%20rounds%26%238230%3B" title="Slashdot" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F36%2Fnew-old-twitter-password-stealer-making-the-rounds&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F36%2Fnew-old-twitter-password-stealer-making-the-rounds&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F36%2Fnew-old-twitter-password-stealer-making-the-rounds&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F36%2Fnew-old-twitter-password-stealer-making-the-rounds&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F36%2Fnew-old-twitter-password-stealer-making-the-rounds&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F36%2Fnew-old-twitter-password-stealer-making-the-rounds&amp;count=horizontal&amp;text=New%20%28old%3F%29%20Twitter%20password%20stealer%20making%20the%20rounds%26%238230%3B" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F36%2Fnew-old-twitter-password-stealer-making-the-rounds&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F36%2Fnew-old-twitter-password-stealer-making-the-rounds&amp;count=horizontal&amp;text=New%20%28old%3F%29%20Twitter%20password%20stealer%20making%20the%20rounds%26%238230%3B" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F36%2Fnew-old-twitter-password-stealer-making-the-rounds&amp;title=New%20%28old%3F%29%20Twitter%20password%20stealer%20making%20the%20rounds%26%238230%3B" id="wpa2a_12"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.falatic.com/index.php/36/new-old-twitter-password-stealer-making-the-rounds/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Moved to a new webhost as well as a new VPS host!</title>
		<link>http://www.falatic.com/index.php/31/moved-to-a-new-webhost-as-well-as-a-new-vps-host</link>
		<comments>http://www.falatic.com/index.php/31/moved-to-a-new-webhost-as-well-as-a-new-vps-host#comments</comments>
		<pubDate>Sun, 10 Jul 2011 10:44:15 +0000</pubDate>
		<dc:creator>Martin Falatic</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[HostGator]]></category>
		<category><![CDATA[Hosting Matters]]></category>
		<category><![CDATA[Linode]]></category>
		<category><![CDATA[shared hosting]]></category>
		<category><![CDATA[Slicehost]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://www.falatic.com/?p=31</guid>
		<description><![CDATA[I have two online hosting systems I routinely use: one is a VPS that I use for things like secure proxy (mostly to secure insecure wireless connections) and otherwise keeping my sysadmin skills fresh. The other is a more typical &#8230; <a class="more-link" href="http://www.falatic.com/index.php/31/moved-to-a-new-webhost-as-well-as-a-new-vps-host">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>I have two online hosting systems I routinely use:</strong> one is a VPS that I use for things like secure proxy (mostly to secure insecure wireless connections) and otherwise keeping my sysadmin skills fresh. The other is a more typical shared hosting server I use for website and email hosting. This week I migrated them to <strong><a href="http://www.linode.com/" target="_blank">Linode</a></strong> and <strong><a href="http://www.hostgator.com/shared.shtml" target="_blank">HostGator</a></strong> respectively, as described below.</p>
<p><span id="more-31"></span>For web/email hosting, I was with <strong>Concentric</strong> way back when (later bought by <strong>XO.com</strong>). I decided to leave<strong> XO.com</strong> when it was clearly unresponsive to the fact that the shared SMTP address was starting to routinely get blacklisted because spammers were hosted on the same machine my sites were unfortunately on. Instead of dealing with the spammers the situation was left as-is and was untenable.</p>
<p>I looked around and found <strong>Hosting Matters</strong> was recommended by people at the time. You can read about them elsewhere, for better or worse. They tended to be pretty responsive but I got tired of the service interruptions on the hosts I was on. Perhaps I was just unlucky that every server I was on ended up overloaded or DDoSed, but after moving servers two or three times it got old.</p>
<p>I also learned much later that <strong>Hosting Matters</strong> is also well-known for hosting right-wing / highly conservative websites (apparently this is why they were getting attacked frequently and why they were pretty good at fending off such attacks). This wasn&#8217;t a good fit for me either &#8211; I prefer my host to be if anything centrist/neutral, not a lightning rod.</p>
<p>After the latest little outage I decided to bite the bullet and migrate to <strong>HostGator</strong>. It&#8217;s also CPanel-based and has most of the same features I was used to (I&#8217;m happy to be able to custom configure SpamAssassin again, and the resource-hogging mailscanner is absent which may also be good). Otherwise the features are almost all identical or slightly better (apparently <strong>Hosting Matters</strong> had automatic backups I was unaware of, which I&#8217;m not seeing on <strong>HostGator</strong>, but that also might be why my <strong>Hosting Matters</strong> server kept bogging down late at night).</p>
<p>I&#8217;m still getting used to it but already there&#8217;s at least two clear differences: the server seems remarkably faster (both in general bandwidth as well as in low load) and I was able to update WordPress and its plugins directly from the WordPress admin panels (something I was never able to do on the previous host). Considering I simply exported and imported the databases and then created/extracted the tarball of the full sites (including the WordPress installations) I was totally shocked that it <em>just worked</em> (I gave it a shot thinking it&#8217;d fail and I&#8217;d investigate what might be wrong&#8230;) The relevant permissions and groups seem the same though.</p>
<p>Note: I didn&#8217;t use <strong>HostGator&#8217;s </strong>migration service&#8230; instead, I configured and migrated it all by hand (for the experience).</p>
<p><strong>The <a href="http://www.hostgator.com/shared.shtml" target="_blank">HostGator</a> bottom line: pleasantly surprised and satisfied so far!</strong></p>
<p>For VPS, I was with <strong>Slicehost</strong> for over two years with a standard single slice. It was interesting and I liked the interface, but their recent acquisition by <strong>Rackspace</strong> was followed by an <a href="http://thenextweb.com/dd/2011/05/03/rackspace-to-shut-down-slicehost/" target="_blank">announcement that Rackspace will discontinue the Slicehost VPS offering in favor of their Cloud offering</a>. I may go back to them later just to try out the whole cloud computing paradigm, but that isn&#8217;t really suitable for my VPS needs.</p>
<p>Seeing a lot of people migrating to <strong>Linode</strong>, I looked into it. For the same money I get more space and memory as well as the ability to use StackScripts, which should make deploying or rebuilding a server as easy as clicking a button.</p>
<p>I used my tried-and-true cheat sheet (which I previously used with my <strong>Slicehost</strong> slice) to create a new Ubuntu 11.04 x64 linode. I had to make a couple of minor changes (I was previously on Ubuntu 10.10) but otherwise my new Linode worked flawlessly!</p>
<p><strong>The <a href="http://www.linode.com/" target="_blank">Linode</a> bottom line: satisfied with the better value and knowing that it&#8217;s not disappearing anytime soon.</strong></p>
<p>** I&#8217;ve pondered moving all my hosting to that VPS, but it doesn&#8217;t make sense, particularly for the email part. (I&#8217;m not thrilled with the idea of outsourcing my email to a third party either.) It&#8217;s a ton of maintenance and upkeep which shared hosting avoids. Tradeoff is potential partial or full outages, but hopefully those stay rare.</p>
<p><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F31%2Fmoved-to-a-new-webhost-as-well-as-a-new-vps-host&amp;linkname=Moved%20to%20a%20new%20webhost%20as%20well%20as%20a%20new%20VPS%20host%21" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F31%2Fmoved-to-a-new-webhost-as-well-as-a-new-vps-host&amp;linkname=Moved%20to%20a%20new%20webhost%20as%20well%20as%20a%20new%20VPS%20host%21" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F31%2Fmoved-to-a-new-webhost-as-well-as-a-new-vps-host&amp;linkname=Moved%20to%20a%20new%20webhost%20as%20well%20as%20a%20new%20VPS%20host%21" title="Tumblr" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_slashdot" href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F31%2Fmoved-to-a-new-webhost-as-well-as-a-new-vps-host&amp;linkname=Moved%20to%20a%20new%20webhost%20as%20well%20as%20a%20new%20VPS%20host%21" title="Slashdot" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F31%2Fmoved-to-a-new-webhost-as-well-as-a-new-vps-host&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F31%2Fmoved-to-a-new-webhost-as-well-as-a-new-vps-host&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F31%2Fmoved-to-a-new-webhost-as-well-as-a-new-vps-host&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F31%2Fmoved-to-a-new-webhost-as-well-as-a-new-vps-host&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F31%2Fmoved-to-a-new-webhost-as-well-as-a-new-vps-host&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F31%2Fmoved-to-a-new-webhost-as-well-as-a-new-vps-host&amp;count=horizontal&amp;text=Moved%20to%20a%20new%20webhost%20as%20well%20as%20a%20new%20VPS%20host%21" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F31%2Fmoved-to-a-new-webhost-as-well-as-a-new-vps-host&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F31%2Fmoved-to-a-new-webhost-as-well-as-a-new-vps-host&amp;count=horizontal&amp;text=Moved%20to%20a%20new%20webhost%20as%20well%20as%20a%20new%20VPS%20host%21" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F31%2Fmoved-to-a-new-webhost-as-well-as-a-new-vps-host&amp;title=Moved%20to%20a%20new%20webhost%20as%20well%20as%20a%20new%20VPS%20host%21" id="wpa2a_14"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.falatic.com/index.php/31/moved-to-a-new-webhost-as-well-as-a-new-vps-host/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problems updating/installing samba4 in Ubuntu 11.04? Read here!</title>
		<link>http://www.falatic.com/index.php/29/problems-with-samba4-when-updating-from-ubuntu-10-10-to-11-04</link>
		<comments>http://www.falatic.com/index.php/29/problems-with-samba4-when-updating-from-ubuntu-10-10-to-11-04#comments</comments>
		<pubDate>Tue, 07 Jun 2011 00:48:09 +0000</pubDate>
		<dc:creator>Martin Falatic</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[11.04]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[ldberror]]></category>
		<category><![CDATA[Natty]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[purge]]></category>
		<category><![CDATA[rootdse]]></category>
		<category><![CDATA[samba]]></category>
		<category><![CDATA[samba4]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.falatic.com/?p=29</guid>
		<description><![CDATA[I recently upgraded my Ubuntu installation from 10.10 to 11.04 and the samba4 package had big problems being updated or installed. I finally found a way to properly install it, so hopefully this will be helpful to others. First, the &#8230; <a class="more-link" href="http://www.falatic.com/index.php/29/problems-with-samba4-when-updating-from-ubuntu-10-10-to-11-04">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently upgraded my Ubuntu installation from 10.10 to 11.04 and the samba4 package had big problems being updated or installed. I finally found a way to properly install it, so hopefully this will be helpful to others.</p>
<p>First, the tail of the installation output for the samba4 package:</p>
<p style="padding-left: 30px;">&#8230;<em><br />
module samba_dsdb initialization failed : No such object</em><br />
<em>Unable to load modules for /var/lib/samba/private/sam.ldb: dsdb_module_search_dn: did not find base dn @ROOTDSE (0 results)</em><br />
<em>Traceback (most recent call last):</em><br />
<em> File &#8220;/usr/share/samba/setup/upgradeprovision&#8221;, line 1597, in &lt;module&gt;</em><br />
<em> ldbs = get_ldbs(paths, creds, session, lp)</em><br />
<em> File &#8220;/usr/lib/python2.7/dist-packages/samba/upgradehelpers.py&#8221;, line 159, in get_ldbs</em><br />
<em> ldbs.sam = SamDB(paths.samdb, session_info=session, credentials=creds, lp=lp, options=["modules:samba_dsdb"])</em><br />
<em> File &#8220;/usr/lib/python2.7/dist-packages/samba/samdb.py&#8221;, line 53, in __init__</em><br />
<em> options=options)</em><br />
<em> File &#8220;/usr/lib/python2.7/dist-packages/samba/__init__.py&#8221;, line 110, in __init__</em><br />
<em> self.connect(url, flags, options)</em><br />
<em> File &#8220;/usr/lib/python2.7/dist-packages/samba/samdb.py&#8221;, line 66, in connect</em><br />
<em> options=options)</em><br />
<em>_ldb.LdbError: (80, &#8216;dsdb_module_search_dn: did not find base dn @ROOTDSE (0 results)&#8217;)</em><br />
<em>dpkg: error processing samba4 (&#8211;configure):</em><br />
<em> subprocess installed post-installation script returned error exit status 1</em><br />
<em>Errors were encountered while processing:</em><br />
<em> samba4</em><br />
<em>E: Sub-process /usr/bin/dpkg returned an error code (1)</em></p>
<p>I first looked around&#8230; a few people had reported similar issues but the answers weren&#8217;t useful. The most common one in several places was, &#8220;Why are you using samba 4? It&#8217;s experimental!&#8221; I&#8217;ve heard that only samba4 works (well | at all?) with Windows 7 protocols. Not sure about that but it was clear that downgrading to regular samba (v3) wasn&#8217;t an ideal solution. (Note: it&#8217;s been a while since I dealt with interop issues on samba&#8230; I apparently originally installed samba4 in 10.04 or 10.10 as part of trying to talk with Windows 7.)</p>
<p>Finally, having done due diligence, <a title="Samba4 failed install report" href="https://bugs.launchpad.net/ubuntu/+source/samba4/+bug/792189" target="_blank">I posted my problem as a bug report</a>. After a few iterations it was mentioned that I should &#8220;purge&#8221; the samba database. Hmm. I didn&#8217;t see that mentioned anywhere else when I searched before (on my particular install error). So I tried it and lo and behold! The purge worked!</p>
<p><strong>So, to install/upgrade samba4 on Ubuntu 11.04, you can try the following (<span style="color: #ff0000;">Disclaimer: always back up first!</span>):</strong></p>
<pre># Attempt to install samba4:

sudo apt-get install samba4

# Assuming it fails to install correctly
#("_ldb.LdbError: (80, 'dsdb_module_search_dn: did not find
# base dn @ROOTDSE (0 results)')" is the error I was dealing
# with), purge samba4:

sudo apt-get purge samba4

# Finally, attempt to install samba4 again:

sudo apt-get install samba4</pre>
<p>That should do it. If it doesn&#8217;t do it, maybe you are having a different issue.</p>
<p><strong><span style="color: #0000ff;">EDIT:</span> There&#8217;s some useful info on <a href="http://www.liberiangeek.net/2011/04/share-home-folder-ubuntu-11-04-natty-narwhal/" target="_blank">this page</a> about configuring Ubuntu 11.04 Samba so as to play nice with Windows</strong>. Also, your smb.conf is probably in /etc/samba&#8230; <em><strong>installing samba doesn&#8217;t install a default config file</strong></em> even if this one is absent. I&#8217;m not sure why yet but I&#8217;d like to know since my existing one is throwing warnings when you run &#8220;samba&#8221; as a command (several &#8220;unknown parameters&#8221; are getting &#8220;ignored&#8221;&#8230; probably fine but I wish I had a clean smb.conf for this release to compare against.)</p>
<p><strong><span style="color: #0000ff;">EDIT2:</span> There&#8217;s <a href="http://www.liberiangeek.net/2011/04/share-files-folders-ubuntu-11-04-natty-narwhal/" target="_blank">another tutorial here</a> about Ubuntu 11.04, Samba 3 and sharing with Windows.</strong></p>
<p><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F29%2Fproblems-with-samba4-when-updating-from-ubuntu-10-10-to-11-04&amp;linkname=Problems%20updating%2Finstalling%20samba4%20in%20Ubuntu%2011.04%3F%20Read%20here%21" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F29%2Fproblems-with-samba4-when-updating-from-ubuntu-10-10-to-11-04&amp;linkname=Problems%20updating%2Finstalling%20samba4%20in%20Ubuntu%2011.04%3F%20Read%20here%21" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F29%2Fproblems-with-samba4-when-updating-from-ubuntu-10-10-to-11-04&amp;linkname=Problems%20updating%2Finstalling%20samba4%20in%20Ubuntu%2011.04%3F%20Read%20here%21" title="Tumblr" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_slashdot" href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F29%2Fproblems-with-samba4-when-updating-from-ubuntu-10-10-to-11-04&amp;linkname=Problems%20updating%2Finstalling%20samba4%20in%20Ubuntu%2011.04%3F%20Read%20here%21" title="Slashdot" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F29%2Fproblems-with-samba4-when-updating-from-ubuntu-10-10-to-11-04&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F29%2Fproblems-with-samba4-when-updating-from-ubuntu-10-10-to-11-04&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F29%2Fproblems-with-samba4-when-updating-from-ubuntu-10-10-to-11-04&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F29%2Fproblems-with-samba4-when-updating-from-ubuntu-10-10-to-11-04&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F29%2Fproblems-with-samba4-when-updating-from-ubuntu-10-10-to-11-04&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F29%2Fproblems-with-samba4-when-updating-from-ubuntu-10-10-to-11-04&amp;count=horizontal&amp;text=Problems%20updating%2Finstalling%20samba4%20in%20Ubuntu%2011.04%3F%20Read%20here%21" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F29%2Fproblems-with-samba4-when-updating-from-ubuntu-10-10-to-11-04&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F29%2Fproblems-with-samba4-when-updating-from-ubuntu-10-10-to-11-04&amp;count=horizontal&amp;text=Problems%20updating%2Finstalling%20samba4%20in%20Ubuntu%2011.04%3F%20Read%20here%21" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F29%2Fproblems-with-samba4-when-updating-from-ubuntu-10-10-to-11-04&amp;title=Problems%20updating%2Finstalling%20samba4%20in%20Ubuntu%2011.04%3F%20Read%20here%21" id="wpa2a_16"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.falatic.com/index.php/29/problems-with-samba4-when-updating-from-ubuntu-10-10-to-11-04/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Worthwhile reading for current or potential 64-bit developers&#8230;</title>
		<link>http://www.falatic.com/index.php/28/worthwhile-reading-for-64-bit-devs</link>
		<comments>http://www.falatic.com/index.php/28/worthwhile-reading-for-64-bit-devs#comments</comments>
		<pubDate>Tue, 31 May 2011 04:09:35 +0000</pubDate>
		<dc:creator>Martin Falatic</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.falatic.com/?p=28</guid>
		<description><![CDATA[I read this CodeProject article today and found it quite enlightening with regard to the pitfalls of 64-bit programing for those used to 32-bit programming. It&#8217;s well worth a read if you are a developer who wants to write solid &#8230; <a class="more-link" href="http://www.falatic.com/index.php/28/worthwhile-reading-for-64-bit-devs">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I read <a href="http://www.codeproject.com/KB/cpp/Examples-64-bit-Errors.aspx" target="_blank">this CodeProject article</a> today and found it quite enlightening with regard to the pitfalls of 64-bit programing for those used to 32-bit programming. It&#8217;s well worth a read if you are a developer who wants to write solid 64-bit code!</p>
<p><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F28%2Fworthwhile-reading-for-64-bit-devs&amp;linkname=Worthwhile%20reading%20for%20current%20or%20potential%2064-bit%20developers%26%238230%3B" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F28%2Fworthwhile-reading-for-64-bit-devs&amp;linkname=Worthwhile%20reading%20for%20current%20or%20potential%2064-bit%20developers%26%238230%3B" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F28%2Fworthwhile-reading-for-64-bit-devs&amp;linkname=Worthwhile%20reading%20for%20current%20or%20potential%2064-bit%20developers%26%238230%3B" title="Tumblr" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_slashdot" href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F28%2Fworthwhile-reading-for-64-bit-devs&amp;linkname=Worthwhile%20reading%20for%20current%20or%20potential%2064-bit%20developers%26%238230%3B" title="Slashdot" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F28%2Fworthwhile-reading-for-64-bit-devs&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F28%2Fworthwhile-reading-for-64-bit-devs&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F28%2Fworthwhile-reading-for-64-bit-devs&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F28%2Fworthwhile-reading-for-64-bit-devs&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F28%2Fworthwhile-reading-for-64-bit-devs&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F28%2Fworthwhile-reading-for-64-bit-devs&amp;count=horizontal&amp;text=Worthwhile%20reading%20for%20current%20or%20potential%2064-bit%20developers%26%238230%3B" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F28%2Fworthwhile-reading-for-64-bit-devs&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F28%2Fworthwhile-reading-for-64-bit-devs&amp;count=horizontal&amp;text=Worthwhile%20reading%20for%20current%20or%20potential%2064-bit%20developers%26%238230%3B" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F28%2Fworthwhile-reading-for-64-bit-devs&amp;title=Worthwhile%20reading%20for%20current%20or%20potential%2064-bit%20developers%26%238230%3B" id="wpa2a_18"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.falatic.com/index.php/28/worthwhile-reading-for-64-bit-devs/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Process Output Logging in Linux and Windows</title>
		<link>http://www.falatic.com/index.php/25/process-output-logging</link>
		<comments>http://www.falatic.com/index.php/25/process-output-logging#comments</comments>
		<pubDate>Thu, 19 May 2011 15:09:22 +0000</pubDate>
		<dc:creator>Martin Falatic</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cmd]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[csh]]></category>
		<category><![CDATA[Cygwin]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[stderr]]></category>
		<category><![CDATA[stdout]]></category>
		<category><![CDATA[tcsh]]></category>
		<category><![CDATA[tee]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.falatic.com/?p=25</guid>
		<description><![CDATA[As I was updating this Wikia page, I added a section about how to create a simple logfile. I thought it&#8217;d be useful to expand upon the subject here. Sometimes you want a raw log of whatever happens during a &#8230; <a class="more-link" href="http://www.falatic.com/index.php/25/process-output-logging">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As I was updating <a href="http://cygwin.wikia.com/wiki/How_to_install_a_newer_version_of_GCC" target="_blank">this Wikia page</a>, I added a section about how to create a simple logfile. I thought it&#8217;d be useful to expand upon the subject here.</p>
<p>Sometimes you want a raw log of whatever happens during a process, whether it&#8217;s coming in via STDERR or STDOUT (usually so you can see the warning or error in the context of the rest of the output). A little redirection and judicious use of &#8220;tee&#8221; will accomplish this. You may not know you wanted a log at all until you spent 5 hours running a process and an error occurred 20,000 lines back. Here&#8217;s a quick and easy way to log that output on the off-chance you&#8217;ll need it later!</p>
<p><strong>Simple logging for bash (Linux or Cygwin) <em>or</em> a Windows command prompt </strong>(assumes you have &#8220;tee&#8221; installed somewhere in your path, e.g., via <a href="http://www.cygwin.com/" target="_blank">Cygwin</a>). The &#8220;2&gt;&amp;1&#8243; part redirects STDERR to STDOUT prior to piping STDOUT to &#8220;tee&#8221;:</p>
<pre>MyUtil -arg1 A -arg2 B 2&gt;&amp;1 | tee mylogfile.log</pre>
<p><strong>Simple logging f</strong><strong>or csh/tcsh (Linux or Cygwin)</strong>. The |&amp; forces STDERR to be piped to &#8220;tee&#8221; alone with the usual STDOUT:</p>
<pre>MyUtil -arg1 A -arg2 B      |&amp; tee mylogfile.log</pre>
<p><strong>Note: </strong>non-interactive processes are far more amenable to this&#8230; if manual input is expected  you probably won&#8217;t see the prompt (since tee won&#8217;t flush its buffer  until EOF or a newline, at a minimum (it may buffer MANY lines before  displaying them). If you know when it&#8217;ll occur you CAN enter the data at the appropriate time (or press return or what have you). This is a quick and dirty way to log something you&#8217;d rather not dig into to instrument.</p>
<p><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F25%2Fprocess-output-logging&amp;linkname=Process%20Output%20Logging%20in%20Linux%20and%20Windows" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F25%2Fprocess-output-logging&amp;linkname=Process%20Output%20Logging%20in%20Linux%20and%20Windows" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F25%2Fprocess-output-logging&amp;linkname=Process%20Output%20Logging%20in%20Linux%20and%20Windows" title="Tumblr" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_slashdot" href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F25%2Fprocess-output-logging&amp;linkname=Process%20Output%20Logging%20in%20Linux%20and%20Windows" title="Slashdot" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F25%2Fprocess-output-logging&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F25%2Fprocess-output-logging&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F25%2Fprocess-output-logging&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F25%2Fprocess-output-logging&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F25%2Fprocess-output-logging&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F25%2Fprocess-output-logging&amp;count=horizontal&amp;text=Process%20Output%20Logging%20in%20Linux%20and%20Windows" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F25%2Fprocess-output-logging&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F25%2Fprocess-output-logging&amp;count=horizontal&amp;text=Process%20Output%20Logging%20in%20Linux%20and%20Windows" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F25%2Fprocess-output-logging&amp;title=Process%20Output%20Logging%20in%20Linux%20and%20Windows" id="wpa2a_20"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.falatic.com/index.php/25/process-output-logging/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adventures Building GCC 4.6.0 for Cygwin</title>
		<link>http://www.falatic.com/index.php/23/adventures-building-gcc-4-6-0-for-cygwin</link>
		<comments>http://www.falatic.com/index.php/23/adventures-building-gcc-4-6-0-for-cygwin#comments</comments>
		<pubDate>Thu, 19 May 2011 14:48:19 +0000</pubDate>
		<dc:creator>Martin Falatic</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Cygwin]]></category>
		<category><![CDATA[GCC]]></category>
		<category><![CDATA[GCC 4.6.0]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.falatic.com/?p=23</guid>
		<description><![CDATA[I decided I wanted to try out GCC using Cygwin rather than my usual Ubuntu virtual machine. In the course of this adventure I learned how to build GCC 4.6.0 for Cygwin, got my feet wet over on StackOverflow, and &#8230; <a class="more-link" href="http://www.falatic.com/index.php/23/adventures-building-gcc-4-6-0-for-cygwin">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I decided I wanted to try out GCC using Cygwin rather than my usual Ubuntu virtual machine. In the course of this adventure I learned how to build GCC 4.6.0 for Cygwin, <a href="http://stackoverflow.com/questions/5762816/gcc-4-6-0-build-sanity-check-error" target="_blank">got my feet wet over on StackOverflow</a>, and made some substantial updates on <a href="http://cygwin.wikia.com/wiki/How_to_install_a_newer_version_of_GCC" target="_blank">the Cygwin Wikia for this subject</a>.</p>
<p>Are YOU a Cygwin user who is not satisfied with GCC 3.4.4 (the latest one they offer)? Want to build a far more modern release of GCC for Cygwin? <a href="http://cygwin.wikia.com/wiki/How_to_install_a_newer_version_of_GCC" target="_blank">Read more on the Wikia</a> &#8211; it works: I just spent a few hours (im)proving it!</p>
<p><em>(This also inspired <a href="http://www.falatic.com/index.php/25/process-output-logging">my subsequent post about process logging</a>&#8230; nothing makes good logging worthwhile like rebuilding a compiler!)</em></p>
<p><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F23%2Fadventures-building-gcc-4-6-0-for-cygwin&amp;linkname=Adventures%20Building%20GCC%204.6.0%20for%20Cygwin" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F23%2Fadventures-building-gcc-4-6-0-for-cygwin&amp;linkname=Adventures%20Building%20GCC%204.6.0%20for%20Cygwin" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F23%2Fadventures-building-gcc-4-6-0-for-cygwin&amp;linkname=Adventures%20Building%20GCC%204.6.0%20for%20Cygwin" title="Tumblr" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_slashdot" href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F23%2Fadventures-building-gcc-4-6-0-for-cygwin&amp;linkname=Adventures%20Building%20GCC%204.6.0%20for%20Cygwin" title="Slashdot" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F23%2Fadventures-building-gcc-4-6-0-for-cygwin&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F23%2Fadventures-building-gcc-4-6-0-for-cygwin&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F23%2Fadventures-building-gcc-4-6-0-for-cygwin&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F23%2Fadventures-building-gcc-4-6-0-for-cygwin&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F23%2Fadventures-building-gcc-4-6-0-for-cygwin&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F23%2Fadventures-building-gcc-4-6-0-for-cygwin&amp;count=horizontal&amp;text=Adventures%20Building%20GCC%204.6.0%20for%20Cygwin" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F23%2Fadventures-building-gcc-4-6-0-for-cygwin&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F23%2Fadventures-building-gcc-4-6-0-for-cygwin&amp;count=horizontal&amp;text=Adventures%20Building%20GCC%204.6.0%20for%20Cygwin" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F23%2Fadventures-building-gcc-4-6-0-for-cygwin&amp;title=Adventures%20Building%20GCC%204.6.0%20for%20Cygwin" id="wpa2a_22"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.falatic.com/index.php/23/adventures-building-gcc-4-6-0-for-cygwin/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Interesting Software Development Resources</title>
		<link>http://www.falatic.com/index.php/19/interesting-software-development-resources</link>
		<comments>http://www.falatic.com/index.php/19/interesting-software-development-resources#comments</comments>
		<pubDate>Tue, 23 Nov 2010 13:07:55 +0000</pubDate>
		<dc:creator>Martin Falatic</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.falatic.com/?p=19</guid>
		<description><![CDATA[Here are some interesting resources I&#8217;ve found with regard to software development. [Note that embedded best-practices are also applicable to writing multi-threaded code and coding in other resource-limited environments]: Interesting software dev articles from EE Times: &#8220;Top causes of nasty &#8230; <a class="more-link" href="http://www.falatic.com/index.php/19/interesting-software-development-resources">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here are some interesting resources I&#8217;ve found with regard to software development. [Note that embedded best-practices are also applicable to writing   multi-threaded code and coding in other resource-limited environments]:</p>
<ul>
<li>Interesting software dev articles from <em>EE Times</em>:
<ul>
<li><em>&#8220;Top causes of nasty embedded software bugs&#8221;</em>: <a title="Part 2" href="http://www.eetimes.com/discussion/other/4210308/Five-more-top-causes-of-nasty-embedded-software-bugs" target="_blank">Part 1</a> <a title="Part 2" href="http://www.eetimes.com/discussion/other/4210308/Five-more-top-causes-of-nasty-embedded-software-bugs" target="_blank">Part 2</a></li>
<li><em>&#8220;Bug-killing standards for firmware coding&#8221;</em>: <a title="Part 2" href="http://www.eetimes.com/discussion/barr-code/4027006/More-bug-killing-standards-for-firmware-coding" target="_blank">Part 1</a> <a title="Part 2" href="http://www.eetimes.com/discussion/barr-code/4027006/More-bug-killing-standards-for-firmware-coding" target="_blank">Part 2</a></li>
</ul>
</li>
</ul>
<ul>
<li><em><a href="http://oreilly.com/catalog/9780596809492" target="_blank">97 Things Every Programmer Should Know</a></em>:<strong><em></em></strong> An interesting little book that covers many aspects of the software development process (I have to add that you shouldn&#8217;t be afraid to break things <em>unless</em> that thing is the build. <em>Don&#8217;t Break The Build!</em>)</li>
</ul>
<ul>
<li><em><a href="http://www.netrino.com/Coding-Standard" target="_blank">Embedded C Coding Standard as envisioned by Netrino</a></em>: A (quite expensive) book (the reviews I&#8217;ve read are a mixed bag as well). I&#8217;m not recommending it so much as pointing out that it exists and is well-regarded in some circles.</li>
</ul>
<p>As an aside, while &#8220;don&#8217;t break the build&#8221; became my mantra early in my SCM roles, I had <em>no idea</em> how many variants there are on that theme on the web&#8230; everything from websites to t-shirts to videos. LOL! <img src='http://www.falatic.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </p>
<p><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F19%2Finteresting-software-development-resources&amp;linkname=Interesting%20Software%20Development%20Resources" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F19%2Finteresting-software-development-resources&amp;linkname=Interesting%20Software%20Development%20Resources" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F19%2Finteresting-software-development-resources&amp;linkname=Interesting%20Software%20Development%20Resources" title="Tumblr" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_slashdot" href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F19%2Finteresting-software-development-resources&amp;linkname=Interesting%20Software%20Development%20Resources" title="Slashdot" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F19%2Finteresting-software-development-resources&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F19%2Finteresting-software-development-resources&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F19%2Finteresting-software-development-resources&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F19%2Finteresting-software-development-resources&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F19%2Finteresting-software-development-resources&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F19%2Finteresting-software-development-resources&amp;count=horizontal&amp;text=Interesting%20Software%20Development%20Resources" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F19%2Finteresting-software-development-resources&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F19%2Finteresting-software-development-resources&amp;count=horizontal&amp;text=Interesting%20Software%20Development%20Resources" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F19%2Finteresting-software-development-resources&amp;title=Interesting%20Software%20Development%20Resources" id="wpa2a_24"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.falatic.com/index.php/19/interesting-software-development-resources/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Photocopiers and privacy &#8211; things to ponder</title>
		<link>http://www.falatic.com/index.php/14/photocopiers-and-privacy</link>
		<comments>http://www.falatic.com/index.php/14/photocopiers-and-privacy#comments</comments>
		<pubDate>Tue, 18 May 2010 08:49:54 +0000</pubDate>
		<dc:creator>Martin Falatic</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.falatic.com/?p=14</guid>
		<description><![CDATA[I noticed this article at Lifehacker today about how much data today&#8217;s photocopiers retain.  It may seem like sensationalist journalism but it&#8217;s actually quite interesting and worrisome.  People are growing accustomed to the idea of securing personal data, not giving &#8230; <a class="more-link" href="http://www.falatic.com/index.php/14/photocopiers-and-privacy">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I noticed <a title="Erase Your Copy Machine's Hard Drive to Wipe Important Documents" href="http://lifehacker.com/5540834/erase-your-copy-machines-hard-drive-to-wipe-important-documents" target="_blank">this article at Lifehacker</a> today about how much data today&#8217;s photocopiers retain.  It may seem like sensationalist journalism but it&#8217;s actually quite interesting and worrisome.  People are growing accustomed to the idea of securing personal data, not giving out account number via email, using passwords, that sort of thing, but one doesn&#8217;t usually think of a photocopier or printer as something that may store your document indefinitely.  (Previous news stories note how <a href="http://news.bbc.co.uk/2/hi/south_asia/4905052.stm" target="_blank">old flash drives</a> can be a vector for sensitive data leakage.)</p>
<p><span id="more-14"></span>What&#8217;s also very interesting is the aftermarket trade in all this.  As others point out, articles like this are not how criminals learn of such things &#8211; I&#8217;m sure there&#8217;s outfits out there buying up old printers, copiers or just the raw drives themselves, selectively, simply to vacuum useful info from them.</p>
<p>Why encryption and wipe-on-completion isn&#8217;t mandated is a mystery to me.  An exec suggested it&#8217;s a $500 add-on for one company&#8217;s products, but to me it should be a fundamental part of the product&#8217;s design!  Is it so hard to at least write a routine that overwrites a used/deleted file?  Not at all!  A big, fat &#8220;factory wipe&#8221; option loudly proclaimed in the manual?  A fraction of a cent&#8217;s worth of ink.</p>
<p>Note: encryption would be a good thing, but doing it <em>right </em>would add to hardware and design costs &#8211; otherwise the keys (being locally stored) are not much more secure than the data.  It&#8217;s far simpler to implement wipe-after-use and wipe-nightly.</p>
<p>See also the CBS video of this:<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="500" height="405" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube-nocookie.com/v/iC38D5am7go&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;border=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="500" height="405" src="http://www.youtube-nocookie.com/v/iC38D5am7go&amp;hl=en_US&amp;fs=1&amp;rel=0&amp;border=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F14%2Fphotocopiers-and-privacy&amp;linkname=Photocopiers%20and%20privacy%20%26%238211%3B%20things%20to%20ponder" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F14%2Fphotocopiers-and-privacy&amp;linkname=Photocopiers%20and%20privacy%20%26%238211%3B%20things%20to%20ponder" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F14%2Fphotocopiers-and-privacy&amp;linkname=Photocopiers%20and%20privacy%20%26%238211%3B%20things%20to%20ponder" title="Tumblr" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_slashdot" href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F14%2Fphotocopiers-and-privacy&amp;linkname=Photocopiers%20and%20privacy%20%26%238211%3B%20things%20to%20ponder" title="Slashdot" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F14%2Fphotocopiers-and-privacy&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F14%2Fphotocopiers-and-privacy&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F14%2Fphotocopiers-and-privacy&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F14%2Fphotocopiers-and-privacy&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F14%2Fphotocopiers-and-privacy&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F14%2Fphotocopiers-and-privacy&amp;count=horizontal&amp;text=Photocopiers%20and%20privacy%20%26%238211%3B%20things%20to%20ponder" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F14%2Fphotocopiers-and-privacy&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F14%2Fphotocopiers-and-privacy&amp;count=horizontal&amp;text=Photocopiers%20and%20privacy%20%26%238211%3B%20things%20to%20ponder" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F14%2Fphotocopiers-and-privacy&amp;title=Photocopiers%20and%20privacy%20%26%238211%3B%20things%20to%20ponder" id="wpa2a_26"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.falatic.com/index.php/14/photocopiers-and-privacy/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building ZXing for Android part 3 – Using Eclipse</title>
		<link>http://www.falatic.com/index.php/12/building-zxing-for-android-part-3-using-eclipse</link>
		<comments>http://www.falatic.com/index.php/12/building-zxing-for-android-part-3-using-eclipse#comments</comments>
		<pubDate>Fri, 26 Feb 2010 08:42:25 +0000</pubDate>
		<dc:creator>Martin Falatic</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Ant]]></category>
		<category><![CDATA[Barcode Scanner]]></category>
		<category><![CDATA[building]]></category>
		<category><![CDATA[Droid]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[success]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[ZXing]]></category>

		<guid isPermaLink="false">http://www.falatic.com/?p=12</guid>
		<description><![CDATA[Several iterations of updates below: Update 1: This procedure works on the zxing-1.4.zip source base.  I&#8217;m trying to figure out why it doesn&#8217;t want to work easily with the most current SVN code (e.g., rev 1217 or 1220).  I thought &#8230; <a class="more-link" href="http://www.falatic.com/index.php/12/building-zxing-for-android-part-3-using-eclipse">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Several iterations of updates below:</p>
<p><span id="more-12"></span></p>
<p><strong><span style="text-decoration: underline;">Update 1:</span> This procedure works on the </strong><em>zxing-1.4.zip</em><strong> source base.  I&#8217;m trying to figure out why it doesn&#8217;t want to work easily with the most current SVN code (e.g., rev 1217 or 1220).  I thought it was just some preloading weirdness that caused the Java Stack Overflow errors, then I thought it was Subversion related, but now&#8230; now I&#8217;m not sure what&#8217;s going on but I&#8217;ll let you know if I figure it out.</strong></p>
<hr />
<p><strong><span style="text-decoration: underline;">Update 2:</span> Eclipse does NOT like the new version of </strong><em>/android/default.properties</em><strong> at all.  After you create the project folders but before you try creating the project in Eclipse, edit </strong><em>/android/default.properties</em><strong> and change</strong></p>
<p>&nbsp;</p>
<pre style="padding-left: 30px;">target=<strong>android-4</strong></pre>
<p><strong>to</strong></p>
<pre style="padding-left: 30px;">target=<strong>Google Inc.:Google APIs:4</strong></pre>
<p><strong>That seems to prevent the whole Stack Overflow problem.  I&#8217;m not sure why this changed or what the more correct thing to do it but there&#8217;s some apparently relevant discussion <a href="http://code.google.com/p/zxing/issues/detail?id=276" target="_blank">here</a>. Curiously, despite my reversion of this change I do not see any problem in my test builds here, whether in Eclipse or when using the command-line build as outlined previously.</strong></p>
<hr />
<p><strong><span style="text-decoration: underline;">Update 3:</span> If you comment out the </strong>target=<strong> line in that file entirely (using &#8220;#&#8221;) the problem <em>also </em>goes away &#8211; be sure to select an SDK level &gt;= 4 though.  Eclipse <em>still </em>forces you to select a Google APIs target, but if you double-click one of the &#8220;un-selectable&#8221; Android targets (click the text NOT the checkbox!) just right it&#8217;ll apparently take the setting and work OK.  Who knows if that works in general &#8211; probably not. With an Android target launching the AVD also goes much more smoothly!</strong></p>
<p>&nbsp;</p>
<p><strong>Question is, what is it that makes Eclipse insist this is an APIs project when default.properties is not giving it any hints? </strong><strong><strong>Or i</strong>s it a quirk of the SDK? </strong><strong>What triggers this, and is it more readily resolved than by doing this?</strong></p>
<hr />
<p><strong><span style="text-decoration: underline;">Update 4:</span> Last update for tonight. Once a project is in   Eclipse you can go to Properties -&gt; Android for that project and   select a suitable Android target.  As long as you don&#8217;t have   dependencies on Google APIs it should be fine.  If you </strong>/android/AndroidManifest.xml<strong> and remove the </strong>android:minSdkVersion<strong> setting that problem goes away as well (again, select Android 1.6 SDK level 4 to ensure proper operation).</strong></p>
<p>&nbsp;</p>
<p><strong>Either it&#8217;s Eclipse 3.5.1 or the ADT plugin that&#8217;s messing up here.  Regardless, it doesn&#8217;t seem to be any flaw in ZXing.  It&#8217;s rather annoying to see Eclipse acting like this&#8230; are other people seeing this sort of bug?</strong></p>
<p><span style="color: #0000ff;"><strong><span style="text-decoration: underline;">To  summarize:</span> to avoid all these painful problems just plain remove </strong>default.properties<strong> and edit </strong>AndroidManifest.xml<strong> before you create a new Eclipse project based on the latest source.   Ensure you select Android 1.6 SDK level 4 for best results.</strong></span></p>
<p><strong><span style="color: #0000ff;">Also, when you run the app it&#8217;s best to just start the AVD first, wiping user data, (or at least uninstalling the old version of your app) and being at the home screen before you &#8220;Run As&#8221;.  Otherwise, the app&#8217;s display ends up rather funky.</span></strong></p>
<p><strong><span style="color: #0000ff;">Finally, &#8220;Build Automatically&#8221; may be more trouble than it&#8217;s worth, at least for a larger project such as this.  Consider this if your head starts making dents in the wall as you struggle to make sense of Eclipse&#8217;s random &#8220;out of memory&#8221; errors. <img src='http://www.falatic.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
</span></strong></p>
<hr />
<p>In my <a href="http://www.falatic.com/index.php/9/building_zxing_for_android" target="_blank">previous post</a> I referred to a <a href="http://knol.google.com/k/alec-go/modifying-the-android-barcode-scanner/2vd5zn6va2fqd/2#" target="_blank">Knol</a> that tells you how to build ZXing for Android (the Barcode Scanner) using the <strong>Eclipse</strong> IDE.  There are pros and cons to doing this, given that ZXing is normally built from the command line using Ant (and during that build it is optimized using Proguard).</p>
<p>&nbsp;</p>
<p>However, my goal is to learn more about Android programming in general and to make it even more interesting, I&#8217;m doing it from Windows.  Having the project working in an IDE is preferable for me when it comes to unraveling functional connections and learning how a (quite useful!) Android app is put together.</p>
<p><!--more--></p>
<p>First of all, that Knol isn&#8217;t all that bad.  It helps if you read it carefully (I kept screwing up a particular step), however some of the steps are unclear apparently because the SDK has changed rather substantially since it was first written.  I&#8217;ve tried to be ridiculously detailed here so as to eliminate any possible confusion for the novice.</p>
<p>Second, it&#8217;s not clear that you need to install <em>anything</em> other than the <a href="http://www.eclipse.org/downloads/" target="_blank">Eclipse Classic 3.5.1</a> IDE and the <a href="http://developer.android.com/sdk/index.html" target="_blank">Android SDK</a> to perform this experiment.  I have the JDK, Ant and Proguard as well but they aren&#8217;t in my system paths nor is JAVA_HOME set system-wide yet.  Therefore I suspect none of that other stuff is getting referenced in this experiment.  You should have the IDE installed, the Android SDK installed and up-to-date, and the ADT Plugin for Eclipse (found on the SDK page).<strong> </strong></p>
<p><span style="text-decoration: underline;"><strong>Initialize the project in Eclipse</strong></span></p>
<ul>
<li>Obtain the <strong>ZXing </strong>source tree via zip or SVN as described in the previous posts.  We are only interested in the <em>/android</em> and the <em>/core/src </em>trees.  The rest of the paths and components may be ignored for the purpose of building the <strong>Barcode Scanner </strong>app for Android.</li>
<li>Place these in a working area.  For this example I used <em>D:\workspace\zxing</em></li>
<li><span style="text-decoration: underline;"><strong>An important note: </strong></span>the Android SDK Content loader doesn&#8217;t immediately start in Eclipse until you attempt to use or create an Adroid project, and it takes a while to load.   Therefore quickly creating a new Android project based on another Android project <em>while the SDK is loading </em>can have unwanted consequences &#8211; particularly, <strong>Stack Overflow</strong>s &#8211; which is apparently due to a race condition (if the Android SDK Content Loader is still processing when you pick the &#8220;based on&#8221; tree, bad, bad things happen).  It was a very distracting problem until I realized what was going on.</li>
<li>Start the Eclipse IDE
<ul>
<li>Close any open projects!</li>
<li> Note that <em>Project -&gt; Build Automatically </em>is selected</li>
</ul>
</li>
<li>From the menu select <em>File -&gt; New -&gt; Project&#8230;</em></li>
<li>In the new window select <em>Android -&gt; Android Project</em></li>
<li>If Build targets are NOT populated at all and there&#8217;s activity in the progress tab:
<ul>
<li>Close the <em>New Project </em>window.</li>
<li>Wait for the Android SDK Content Loader activity to complete (watch the progress tab!)</li>
<li>From the menu select <em>File -&gt; New -&gt; Project&#8230;</em> again</li>
<li>In the new window select <em>Android -&gt; Android Project</em> again</li>
<li>At this point the Build Targets should be properly populated and the progress tab should be idle/empty.</li>
</ul>
</li>
<li>Give the project a name.  For this example I used &#8220;<strong>BarExample</strong>&#8221; and will refer to that going forward.</li>
<li>Select <em>Create project from existing source</em></li>
<li>Browse to where you put the <strong>zxing </strong>source tree (this will become your workspace!)</li>
<li>Select the <em>/android </em>subfolder and click OK</li>
<li>The Build Target will automatically be selected as Google APIs 1.6
<ul>
<li>I&#8217;m not entirely sure why this happens &#8211; you cannot select Android alone either.  I think this is why you are later warned when trying to launch it that there are no compatible devices.</li>
</ul>
</li>
<li>The Application name will be auto-filled as <strong>CaptureActivity</strong></li>
<li>Click <em>Finish</em></li>
</ul>
<p><strong>Allow it to prebuild.  At this point you&#8217;ll have some 250+ errors but the next step should resolve them!</strong></p>
<p><span style="text-decoration: underline;"><strong>Add the <em>/core/src </em>code to your project:</strong></span></p>
<p style="padding-left: 30px;"><span style="color: #808080;"><em><strong><span style="text-decoration: underline;"><span style="text-decoration: line-through;">Hard way #1:</span></span></strong><br />
</em></span></p>
<li style="padding-left: 30px;"><span style="color: #808080;"><span style="text-decoration: line-through;">In the <em>Package Exp </em>tab, right click on the project name (&#8220;BarExample&#8221;) and select <em>New -&gt; Source Folder</em></span></span></li>
<li style="padding-left: 30px;"><span style="color: #808080;"><span style="text-decoration: line-through;">Folder name: <strong>srccore</strong></span></span></li>
<li style="padding-left: 30px;"><span style="color: #808080;"><span style="text-decoration: line-through;">&#8220;Update exclusion&#8221; is UNchecked</span></span></li>
<li style="padding-left: 30px;"><span style="color: #808080;"><span style="text-decoration: line-through;">Click <em>OK</em></span></span></li>
<li style="padding-left: 30px;"><span style="color: #808080;"><span style="text-decoration: line-through;">Now, right click on srccore and <em>Import&#8230;</em></span></span></li>
<li style="padding-left: 30px;"><span style="color: #808080;"><span style="text-decoration: line-through;">Select <em>General -&gt; File System</em> and click <em>Next</em></span></span></li>
<li style="padding-left: 30px;"><span style="color: #808080;"><span style="text-decoration: line-through;">Select the <em>&#8220;core\src&#8221; </em>folder in the zxing source tree and click <em>OK</em></span></span></li>
<li style="padding-left: 30px;"><span style="color: #808080;"><span style="text-decoration: line-through;">You should see the From Directory as <em>D:\workspace\zxing\core\src</em></span></span></li>
<li style="padding-left: 30px;"><span style="color: #808080;"><span style="text-decoration: line-through;">Check the box to the left of the &#8220;src&#8221; folder</span></span></li>
<li style="padding-left: 30px;"><span style="color: #808080;"><span style="text-decoration: line-through;">&#8220;Into folder&#8221; should already be set to <strong><em>BarExample/srccore</em></strong></span></span></li>
<li style="padding-left: 30px;"><span style="color: #808080;"><span style="text-decoration: line-through;">In Options, select <em>Create selected folders only</em></span></span></li>
<li style="padding-left: 30px;"><span style="color: #808080;"><span style="text-decoration: line-through;">Click <em>Finish</em></span></span></li>
<p style="padding-left: 30px;"><span style="color: #808080;"><em><strong><span style="text-decoration: underline;"><span style="text-decoration: line-through;">Hard way #2:</span></span></strong></em></span></p>
<p style="padding-left: 30px;"><span style="color: #808080;"><span style="text-decoration: line-through;">A somewhat easier way to do this (avoiding the extra copy) is to put <em>/core/src</em> <span style="text-decoration: underline;">under</span><em> </em><em>/android</em> (thus creating <em>/android/core/src</em>) <strong>before </strong>you initialize the project!  Then, <strong>after </strong>you initialize the project you can pick the <em>src </em>folder under the <em>core </em>entry in the project items and select <em>Build Path -&gt; Use as a Source Folder</em> to have the desired effect (it&#8217;ll crete an entry called <em>core/src</em>).  I would expect a symlink, correctly applied, would also have the desired effect.  As you can see, the <em>android </em>folder itself is really superfluous here.  [I still think there's got to be an even easier way to gather this all together, without moving ANYTHING around.]</span></span></p>
<p><strong>The best way to add <em>/core/src </em>to your project!</strong> No symlinks required (and being Windows it&#8217;s possible but not easy and besides this is even more minimalist) and it should work seamlessly even if you&#8217;re doing thing with Subversion-controlled code.</p>
<p>You&#8217;ve already created a project area called zxing (or whatever) and in it are the /android tree and the /core/src tree. Rather than manually or automatically move ANY code, simply do this:</p>
<ul>
<li>In the <em>Package Exp </em>tab, right click on the project name  (&#8220;BarExample&#8221;) and select <em>Build Path -&gt; Link Source&#8230;</em></li>
<li>Browse to and select the <strong><em>src </em></strong>folder in <strong><em>core</em></strong>.</li>
<li>Change <em>Folder name</em> to <strong><em>srccore </em></strong>(or any other not-in-use folder name you prefer).</li>
<li>Select <em>Finish</em></li>
<li>Let it rebuild automagically</li>
</ul>
<p><strong>If you were successful, you should see a whole mess of warnings (I see over 170) &#8211; but no errors!</strong></p>
<p><span style="text-decoration: underline;"><strong>To install and test this on the Android Virtual Device:</strong></span></p>
<ul style="padding-left: 30px;">
<li>Go to the Android SDK and AVD Manager and start your test device
<ul>
<li>I previously created a Droid-compatible device configured as Platform 2.0.1 API Level 6, with a WVGA854 display and a 32M SD card.</li>
<li>Select the device and click<em> Start&#8230;</em></li>
<li>To avoid weirdness I elected to run with a clean slate and so I selected the &#8220;Wipe user data&#8221; option</li>
<li>The virtual device should start up.</li>
<li>You can (and probably should) close the AVD Manager at this point. Leaving the manager on led to an odd &#8220;GC overhead limit exceeded&#8221; error.</li>
<li>Wait patiently for the main screen to appear (it seems to take quite a while and a lot of CPU &#8211; is it just me?)</li>
<li>You shouldn&#8217;t have any other versions of this Barcode app installed at this point.  If you DO you should probably uninstall them first!</li>
</ul>
</li>
<li>Now, back to Eclipse!
<ul>
<li>In your project, select <em>Run As -&gt; Android Application</em></li>
<li>At this point I get an AVD error telling me &#8220;No compatible targets were found&#8221;.</li>
<li>I selected &#8220;No&#8221; (I don&#8217;t want to create a new target &#8211; I already have one!)</li>
<li>In the Device Chooser that follows I selected my running 2.0.1 emulator and clicked OK.</li>
<li>(I don&#8217;t know why this happens &#8211; it&#8217;s probably the mismatch between my 2.0.1. AVD and the original APIs 1.6 target.)</li>
</ul>
</li>
<li>The app should upload, install and execute on the virtual device.</li>
<li>Be sure to rotate your local gravitational reference clockwise by 90° for the  optimum viewing experience.  See the January, 2153 quantum multicast of <em>Make:  The Virtual Magazine </em>for info on how to construct a portable  graviton generator for this purpose.</li>
<li>It&#8217;s not terribly interesting at this point but should work and look normal (not wiping user data and/or letting it launch the app before the screen is &#8220;unlocked&#8221; had something to do with the display looking rather weird &#8211; I&#8217;m not sure what was going wrong).</li>
<li>(Really, why doesn&#8217;t the AVD have a rotate function?  It seems  pretty fundamental.  Likewise some way to fake camera input &#8211; do tell if  I&#8217;m missing a simple way to do either!)</li>
</ul>
<p><strong>Like I&#8217;ve mentioned, I got various odd little IDE errors as I made my way through all this&#8230; perhaps I&#8217;m doing something that&#8217;s not entirely right or the Eclipse IDE / Android SDK combination isn&#8217;t very stable.<br />
</strong></p>
<p>But <em>will it blend</em>?  That is, will it work on a physical device?  Heck yeah!</p>
<p><span style="text-decoration: underline;"><strong>To install and test this on an Android physical device:</strong></span></p>
<ul style="padding-left: 30px;">
<li>First, uninstall the current Barcode Scanner from your phone (you shouldn&#8217;t need to do it each time you cycle through your private test builds, but you DEFINITELY need to if you are switching between the officially signed to the unsigned or debug signed versions!  In short: if you get an installation error uninstall the app and try intalling it again!</li>
<li> <strong>Note:</strong> for some bizarre reason after installation the Barcode app may be out of order alphabetically in the Manage applications dialog!  Closing the dialog and going back to it via Settings rectifies this.</li>
<li>Copy the application&#8217;s APK from<em> /android/bin</em> to your phone</li>
<li>Install the application</li>
<li>Run the Barcode Scanner!</li>
</ul>
<p><strong>That&#8217;s about it!  I&#8217;d expect this to work just as well from a Linux host but I haven&#8217;t tested it.</strong></p>
<p><span style="text-decoration: underline;"><strong>Caveats:</strong></span></p>
<ul style="padding-left: 30px;">
<li><strong>Proguard </strong>isn&#8217;t being used in this configuration AFAIK.  Therefore, things aren&#8217;t optimized (I&#8217;m not yet clear on why that&#8217;s necessary &#8211; presumably for performance reasons though it seemed to work OK when I tried it).</li>
<li>AFAIK this is NOT how the ZXing project is normally developed, so if you plan to submit changes to it or otherwise assist with the project you should defer to the project&#8217;s <a href="http://code.google.com/p/zxing/wiki/GettingStarted" target="_blank">standards and procedures</a>.</li>
<li>This procedure worked fine for me but it may or may not work as well for you, and there may be unexpected side-effects (I haven&#8217;t seen any yet but you never know).</li>
</ul>
<p><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F12%2Fbuilding-zxing-for-android-part-3-using-eclipse&amp;linkname=Building%20ZXing%20for%20Android%20part%203%20%E2%80%93%20Using%20Eclipse" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F12%2Fbuilding-zxing-for-android-part-3-using-eclipse&amp;linkname=Building%20ZXing%20for%20Android%20part%203%20%E2%80%93%20Using%20Eclipse" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F12%2Fbuilding-zxing-for-android-part-3-using-eclipse&amp;linkname=Building%20ZXing%20for%20Android%20part%203%20%E2%80%93%20Using%20Eclipse" title="Tumblr" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_slashdot" href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F12%2Fbuilding-zxing-for-android-part-3-using-eclipse&amp;linkname=Building%20ZXing%20for%20Android%20part%203%20%E2%80%93%20Using%20Eclipse" title="Slashdot" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F12%2Fbuilding-zxing-for-android-part-3-using-eclipse&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F12%2Fbuilding-zxing-for-android-part-3-using-eclipse&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F12%2Fbuilding-zxing-for-android-part-3-using-eclipse&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F12%2Fbuilding-zxing-for-android-part-3-using-eclipse&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F12%2Fbuilding-zxing-for-android-part-3-using-eclipse&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F12%2Fbuilding-zxing-for-android-part-3-using-eclipse&amp;count=horizontal&amp;text=Building%20ZXing%20for%20Android%20part%203%20%E2%80%93%20Using%20Eclipse" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F12%2Fbuilding-zxing-for-android-part-3-using-eclipse&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F12%2Fbuilding-zxing-for-android-part-3-using-eclipse&amp;count=horizontal&amp;text=Building%20ZXing%20for%20Android%20part%203%20%E2%80%93%20Using%20Eclipse" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F12%2Fbuilding-zxing-for-android-part-3-using-eclipse&amp;title=Building%20ZXing%20for%20Android%20part%203%20%E2%80%93%20Using%20Eclipse" id="wpa2a_28"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.falatic.com/index.php/12/building-zxing-for-android-part-3-using-eclipse/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Building ZXing for Android part 2 &#8211; Subversion!</title>
		<link>http://www.falatic.com/index.php/11/building-zxing-for-android-part-2-subversion</link>
		<comments>http://www.falatic.com/index.php/11/building-zxing-for-android-part-2-subversion#comments</comments>
		<pubDate>Wed, 24 Feb 2010 10:15:23 +0000</pubDate>
		<dc:creator>Martin Falatic</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Barcode Scanner]]></category>
		<category><![CDATA[building]]></category>
		<category><![CDATA[Droid]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[success]]></category>
		<category><![CDATA[TortoiseSVN]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[ZXing]]></category>

		<guid isPermaLink="false">http://www.falatic.com/?p=11</guid>
		<description><![CDATA[Well, that was fast!  I decided to give Subversion a whirl with the ZXing codebase before signing off for the night&#8230; and I apparently chose well when I selected TortoiseSVN as my Subversion client for Windows! It went very smoothly! &#8230; <a class="more-link" href="http://www.falatic.com/index.php/11/building-zxing-for-android-part-2-subversion">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Well, that was fast!  I decided to give Subversion a whirl with the <strong>ZXing</strong> codebase before signing off for the night&#8230; and I apparently chose well when I selected <a href="http://tortoisesvn.net/" target="_blank">TortoiseSVN</a> as my Subversion client for Windows!</p>
<p><strong>It went very smoothly! </strong>Here&#8217;s the details:</p>
<p><span id="more-11"></span></p>
<ul>
<li>Install the <a href="http://tortoisesvn.net/" target="_blank">TortoiseSVN</a> client (then reboot)</li>
</ul>
<ul>
<li>Create a folder to work in (e.g., &#8220;D:\zxing-test&#8221;)</li>
</ul>
<ul>
<li>Right-click in/on the folder and select &#8220;SVN Checkout&#8230;&#8221;<br />
- Edit the &#8220;Checkout Directory&#8221; accordingly<br />
- I used the info at the <a href="http://code.google.com/p/zxing/source/checkout" target="_blank">ZXing SVN page</a> to get the required URL (<em>http://zxing.googlecode.com/svn/trunk/</em>).  Note that the &#8220;<em>zxing-read-only</em>&#8221; part caused problems here (it&#8217;s not valid syntax for this client). You cannot commit changes without being a member of the group so leave it off when using TortoiseSVN.<br />
- I did a fully recursive code pull the first time.<br />
- I selected the HEAD revision of the version tree.</li>
</ul>
<ul>
<li>Time passes as you download quite a helluva lot of code!  Broadband helps&#8230;</li>
</ul>
<ul>
<li>For this experiment the last commit version turned out to be revision <strong>1217</strong>.  I&#8217;m not sure how they manage their changes but it&#8217;s always possible you could be unlucky and get a revision level that&#8217;ll lead to a broken build.  (Fortunately, tonight&#8217;s my lucky night!)  You can specify this when you start the SVN interaction above, or you can &#8220;revert&#8221; to this version (or any other) later if you prefer.</li>
</ul>
<ul>
<li>Prep and build it!<br />
- Edit <em>build.properties</em> as I described in <a href="http://www.falatic.com/index.php/9/building_zxing_for_android" target="_blank">my last post</a>.<br />
- Build the source tree (be sure to set <strong>MY_PROJ_ROOT</strong> correctly to point to the SVN-derived tree!)  Use the debug target as before (I&#8217;ve yet to try the release one though I suspect the lack of signing will cause problems).</li>
</ul>
<p><strong>And again, voilà!  You&#8217;ve got a new build!</strong> (I notice the first &#8220;clean&#8221; build step no longer throws a small error as it did before&#8230; it didn&#8217;t affect things but it was nice to see that it got fixed).</p>
<p>I loaded the build onto my Droid and installed it (there was no need to uninstall the older version 3.0 I was testing with earlier &#8211; I don&#8217;t bother with that unless it complains or otherwise fails to install).  On execution the about box shows this is version 3.2 beta 1 (versus the version 3.0 I built earlier and version 3.1 which was the most current in the Android App Market)!  If I&#8217;m going to fiddle around, it&#8217;s nice to know I&#8217;m fiddling with the latest and greatest! <img src='http://www.falatic.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>That concludes my coding evening.  Thanks for visiting!</p>
<p>Note: Other projects use Git&#8230; I installed <a href="http://code.google.com/p/tortoisegit/" target="_blank">TortoiseGit</a> as well but haven&#8217;t had a chance to play with it yet.</p>
<p><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F11%2Fbuilding-zxing-for-android-part-2-subversion&amp;linkname=Building%20ZXing%20for%20Android%20part%202%20%26%238211%3B%20Subversion%21" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F11%2Fbuilding-zxing-for-android-part-2-subversion&amp;linkname=Building%20ZXing%20for%20Android%20part%202%20%26%238211%3B%20Subversion%21" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F11%2Fbuilding-zxing-for-android-part-2-subversion&amp;linkname=Building%20ZXing%20for%20Android%20part%202%20%26%238211%3B%20Subversion%21" title="Tumblr" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_slashdot" href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F11%2Fbuilding-zxing-for-android-part-2-subversion&amp;linkname=Building%20ZXing%20for%20Android%20part%202%20%26%238211%3B%20Subversion%21" title="Slashdot" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F11%2Fbuilding-zxing-for-android-part-2-subversion&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F11%2Fbuilding-zxing-for-android-part-2-subversion&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F11%2Fbuilding-zxing-for-android-part-2-subversion&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F11%2Fbuilding-zxing-for-android-part-2-subversion&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F11%2Fbuilding-zxing-for-android-part-2-subversion&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F11%2Fbuilding-zxing-for-android-part-2-subversion&amp;count=horizontal&amp;text=Building%20ZXing%20for%20Android%20part%202%20%26%238211%3B%20Subversion%21" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F11%2Fbuilding-zxing-for-android-part-2-subversion&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F11%2Fbuilding-zxing-for-android-part-2-subversion&amp;count=horizontal&amp;text=Building%20ZXing%20for%20Android%20part%202%20%26%238211%3B%20Subversion%21" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F11%2Fbuilding-zxing-for-android-part-2-subversion&amp;title=Building%20ZXing%20for%20Android%20part%202%20%26%238211%3B%20Subversion%21" id="wpa2a_30"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.falatic.com/index.php/11/building-zxing-for-android-part-2-subversion/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building ZXing for Android &#8211; lessons learned</title>
		<link>http://www.falatic.com/index.php/9/building-zxing-for-android-part-1</link>
		<comments>http://www.falatic.com/index.php/9/building-zxing-for-android-part-1#comments</comments>
		<pubDate>Wed, 24 Feb 2010 08:24:29 +0000</pubDate>
		<dc:creator>Martin Falatic</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Ant]]></category>
		<category><![CDATA[Barcode Scanner]]></category>
		<category><![CDATA[building]]></category>
		<category><![CDATA[Droid]]></category>
		<category><![CDATA[success]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[ZXing]]></category>

		<guid isPermaLink="false">http://www.falatic.com/?p=9</guid>
		<description><![CDATA[Updated based on feedback from the ZXing team. Tonight I decided to try my hand again at building an Android app &#8211; this time, one that should in theory be easy and yet feature-rich enough to learn from.  It was &#8230; <a class="more-link" href="http://www.falatic.com/index.php/9/building-zxing-for-android-part-1">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><em><strong>Updated based on feedback from the ZXing team.</strong></em></p>
<p>Tonight I decided to try my hand again at building an Android app &#8211; this time, one that should in theory be easy and yet feature-rich enough to learn from.  It was far from the simple experiment it ought to have been, so I&#8217;m sharing my experience to hopefully save you the reader some time if you try this yourself!</p>
<p><strong><a title="ZXing code page" href="http://code.google.com/p/zxing/" target="_blank">ZXing</a> </strong>is the heart of the <strong>Barcode Scanner</strong> app for Android.  It&#8217;s nifty though it doesn&#8217;t take full advantage of my Droid&#8217;s camera resolution and there are some other tricks I&#8217;d like to see it do (such as activate the flash for improved lighting, replacing the constant autofocus with a forced focus, and perhaps adding some decoding protocols that aren&#8217;t supported in the Droid build of this, at least as of Barcode Scanner v3.1).  My main goal was to simply rebuild the app for the Android target via a Windows host, then play around with the code to learn more about Android coding.</p>
<p><strong><a title="ZXing code page" href="http://code.google.com/p/zxing/" target="_blank"><span id="more-9"></span></a></strong></p>
<p>I&#8217;d recently moved some install folders around so I decided to install the necessary parts from scratch.  Note that I first spent an hour or two trying to use Eclipse 3.5.1 to build this but haven&#8217;t gotten it to work (yet).  When I decided to try doing this via &#8220;basic principles&#8221; it quickly became apparent that this would take a while.</p>
<p>I ran into several issues I won&#8217;t bore you with here.  Suffice to say the answers are scattered around Google, either in the ZXing comments, discussions, or its bugs area, and sometimes completely elsewhere.  It became clear that while Windows is supported as a host it&#8217;s probably not the primary host they test builds from, so their <a href="http://code.google.com/p/zxing/wiki/GettingStarted" target="_blank">instructions</a> <em><span style="text-decoration: line-through;">aren&#8217;t very current or coherent for it</span></em> needed some tweaks, which they&#8217;ve made.  (Windows isn&#8217;t the most common way to build for Android but it&#8217;s quite do-able just the same.)</p>
<p><strong>Here, then, is the distillation of what I learned in order to successfully build the Barcode Scanner app for Android via Windows.</strong> This should apply to other Windows versions as well, at least back to XP.  If you are using an x86-based Windows then use x86 installers instead of x64 installers (where there&#8217;s a difference).</p>
<pre><strong># This is the setup for a Windows 7 host (64-bit on an Intel CPU)
</strong>
<strong># Install Sun JDK (jdk-6u18-windows-x##):</strong>
 - Source: <a href="http://java.sun.com/javase/downloads/index.jsp" target="_blank">http://java.sun.com/javase/downloads/index.jsp</a>
    - Select the JDK appropriate to your Windows host (x64 or x86)
 - My root folder: "C:\Program Files\Java\jdk1.6.0_18"

<span style="text-decoration: line-through;"><strong># Install Sun WTK 2.5.2 (sun_java_wireless_toolkit-2.5.2_01-win.exe)</strong>:
 - Yes, you need this too!
 - Source: <a href="http://java.sun.com/products/sjwtoolkit/" target="_blank">http://java.sun.com/products/sjwtoolkit/</a>
    - Select Sun Java Wireless Toolkit 2.5.2_01 for CLDC
 - My root folder: "C:\WTK2.5.2_01"</span>

<strong># WTK is NOT required for the Android target, but part of its folder structure IS, as follows.</strong>

<strong># Install ProGuard Java Optimizer (proguard4.4.zip):</strong>
 - Source: <a href="http://sourceforge.net/projects/proguard/" target="_blank">http://sourceforge.net/projects/proguard/</a>
 - My root folder: "D:\Programming\proguard4.4"

<strong># Copy the proguard.jar file to the expected location in WTK</strong>:
 copy D:\Programming\proguard4.4\lib\proguard.jar C:\WTK2.5.2_01\bin
 - If the "C:\WTK2.5.2_01\bin" tree doesn't exist, simply create it and populate it as above
    (again, WTK itself is not required for the Android target)

<strong># Install Apache Ant (apache-ant-1.8.0-bin):</strong>
 - Source: <a href="http://ant.apache.org/bindownload.cgi" target="_blank">http://ant.apache.org/bindownload.cgi</a>
 - My root folder: "D:\Programming\apache-ant-1.8.0"

<strong># Install Google Android SDK (android-sdk_r04-windows)</strong>:
 - Source: <a href="http://developer.android.com/sdk/index.html" target="_blank">http://developer.android.com/sdk/index.html</a>
 - My root folder: "D:\Programming\android-sdk-windows"

<strong># Run "android-sdk-windows/SDK Setup":</strong>
 - Update all packages!

<strong># Fix "dx.bat" for Android SDK pre-2.0 (it's broken in those)</strong>:
 - More info in <a href="http://groups.google.com/group/zxing/browse_thread/thread/ca00c576c14dae04/cd52c5b64a" target="_blank">this thread</a>
 cd /d D:\Programming\android-sdk-windows
 copy /y platforms\android-1.1\tools\dx.bat platforms\android-1.1\tools\dx.bat.ORIG
 copy /y platforms\android-2.0\tools\dx.bat platforms\android-1.1\tools
 copy /y platforms\android-1.5\tools\dx.bat platforms\android-1.5\tools\dx.bat.ORIG
 copy /y platforms\android-2.0\tools\dx.bat platforms\android-1.5\tools
 copy /y platforms\android-1.6\tools\dx.bat platforms\android-1.6\tools\dx.bat.ORIG
 copy /y platforms\android-2.0\tools\dx.bat platforms\android-1.6\tools

<strong># Install the ZXing codebase (ZXing-1.4.zip):</strong>
 - Source: <a href="http://code.google.com/p/zxing/downloads/list" target="_blank">http://code.google.com/p/zxing/downloads/list</a>
 - My root folder: "D:\Test\zxing-1.4"

<strong># Edit "zxing-1.4\build.properties":</strong>
 - Note double-backslashes!
 - Update: WTK-home=C:\\WTK2.5.2_01
 - Update: android-home=T:\\Programming\\android-sdk-windows
</pre>
<p><strong>Now, if all that went well you should be ready to build it!</strong></p>
<pre><strong># Open a "cmd.exe" window to work in.</strong>

<strong># Set appropriate environment variables for the tools:</strong>
 set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_18
 set path=%PATH%;D:\Programming\android-sdk-windows\tools
 set path=%PATH%;D:\Programming\apache-ant-1.8.0\bin
 set path=%PATH%;%JAVA_HOME%\bin

<strong># Set the environment variable for the root of your project:</strong>
 set MY_PROJ_ROOT=D:\Programming\workspace\zxing-1.4

<strong># Running the build (repeat as necessary):</strong>
 REM I added this top-level clean step to my process -
 REM It helps when you have tried building from the wrong level!
 cd /d %MY_PROJ_ROOT%  &amp;&amp;  ant clean

 REM Standard build step (see note in android/build.xml)
 cd /d %MY_PROJ_ROOT%\core  &amp;&amp;  ant clean build-no-debug

 REM Debug is the default target - I prefer to name it explicitly
 cd /d %MY_PROJ_ROOT%\android  &amp;&amp;  ant clean debug

 REM OPTIONAL: You can instead build the release version but it's not signed
 cd /d %MY_PROJ_ROOT%\android  &amp;&amp;  ant clean release

<strong># Inspect and use the build output (the APK file is produced if successful)</strong>:
 - %MY_PROJ_ROOT%\android\bin
</pre>
<p><strong>At this point you should have successfully built the Barcode Scanner app for Android!</strong></p>
<p>Load it upon your emulator or phone and see how it works. To try it on your phone, you will probably need to uninstall the current version.  Then you will need to check the <em>&#8220;Settings -&gt; Applications -&gt; Unknown Sources&#8221;</em> box on your phone to install a debug binary like this (As always, be careful when testing in this mode!!)  Copy the APK to your phone and install it.  Voilà!  It worked for me.</p>
<p><strong>Next steps:</strong></p>
<ul>
<li>Seeing if I can do this from within Eclipse.  A <a href="http://knol.google.com/k/alec-go/modifying-the-android-barcode-scanner/2vd5zn6va2fqd/2#" target="_blank">somewhat outdated Knol</a> suggests this is possible, but I had no luck with it. <a href="http://www.falatic.com/index.php/12/building-zxing-for-android-part-3-using-eclipse" target="_blank"><strong><em>Done!</em></strong></a></li>
<li>Install a Subversion client to get the latest code and see how that goes (my expertise is with Clearcase and such so this should be interesting). <strong><a title="Subversion and ZXing on Windows" href="http://www.falatic.com/index.php/11/building-zxing-for-android-part-2-subversion" target="_blank"><em>Done!</em></a></strong></li>
<li>Modifying some code! <strong><a title="Subversion and ZXing on Windows" href="http://www.falatic.com/index.php/11/building-zxing-for-android-part-2-subversion" target="_blank"><em>Done!</em></a></strong></li>
</ul>
<p><strong><span style="text-decoration: underline;">Disclaimer:</span> I&#8217;m NOT attached to the ZXing project at all, I&#8217;m just putting this out there in the hopes that it&#8217;ll help others have an easier time at this than I did.  I probably cannot help you with any issues you have (especially for other host or target platforms).<br />
</strong></p>
<p><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F9%2Fbuilding-zxing-for-android-part-1&amp;linkname=Building%20ZXing%20for%20Android%20%26%238211%3B%20lessons%20learned" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F9%2Fbuilding-zxing-for-android-part-1&amp;linkname=Building%20ZXing%20for%20Android%20%26%238211%3B%20lessons%20learned" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F9%2Fbuilding-zxing-for-android-part-1&amp;linkname=Building%20ZXing%20for%20Android%20%26%238211%3B%20lessons%20learned" title="Tumblr" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_slashdot" href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F9%2Fbuilding-zxing-for-android-part-1&amp;linkname=Building%20ZXing%20for%20Android%20%26%238211%3B%20lessons%20learned" title="Slashdot" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F9%2Fbuilding-zxing-for-android-part-1&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F9%2Fbuilding-zxing-for-android-part-1&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F9%2Fbuilding-zxing-for-android-part-1&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F9%2Fbuilding-zxing-for-android-part-1&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F9%2Fbuilding-zxing-for-android-part-1&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F9%2Fbuilding-zxing-for-android-part-1&amp;count=horizontal&amp;text=Building%20ZXing%20for%20Android%20%26%238211%3B%20lessons%20learned" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F9%2Fbuilding-zxing-for-android-part-1&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F9%2Fbuilding-zxing-for-android-part-1&amp;count=horizontal&amp;text=Building%20ZXing%20for%20Android%20%26%238211%3B%20lessons%20learned" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F9%2Fbuilding-zxing-for-android-part-1&amp;title=Building%20ZXing%20for%20Android%20%26%238211%3B%20lessons%20learned" id="wpa2a_32"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.falatic.com/index.php/9/building-zxing-for-android-part-1/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Fun with bootable flash drives!</title>
		<link>http://www.falatic.com/index.php/7/fun-with-bootable-flash-drives</link>
		<comments>http://www.falatic.com/index.php/7/fun-with-bootable-flash-drives#comments</comments>
		<pubDate>Wed, 22 Apr 2009 02:25:58 +0000</pubDate>
		<dc:creator>Martin Falatic</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[flash drives]]></category>
		<category><![CDATA[GParted]]></category>
		<category><![CDATA[removable bit]]></category>
		<category><![CDATA[Super Grub]]></category>
		<category><![CDATA[UAC]]></category>
		<category><![CDATA[UBCD4Win]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Vista]]></category>

		<guid isPermaLink="false">http://www.falatic.com/?p=7</guid>
		<description><![CDATA[I&#8217;ve been fiddling with making bootable flash drives lately, via UBCD4Win for the most part.  It&#8217;s actually come in handy a few times in the last month alone and the new v3.50 just came out today!  In the course of &#8230; <a class="more-link" href="http://www.falatic.com/index.php/7/fun-with-bootable-flash-drives">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been fiddling with making bootable flash drives lately, via <a title="UBCD4Win homepage" href="http://www.ubcd4win.com/" target="_blank">UBCD4Win</a> for the most part.  It&#8217;s actually come in handy a few times in the last month alone and the new v3.50 just came out today!  In the course of this I&#8217;ve learned a couple of useful things that might be worthwhile to others working on this.</p>
<p><span id="more-7"></span></p>
<hr />
<h3>Flash Drives and The Removable Bit</h3>
<p>Something I stumbled upon today was a Lexar utility that can flip the removable bit on a flash drive.  <span style="color: #800000;"><span style="text-decoration: underline;"><strong>Disclaimer: this may not work for you or could even cause problems!</strong></span></span> As you may have noticed a flash drive appears as a &#8220;removable disk&#8221; in explorer, and (as I understand it) cannot be partitioned in XP or lower (Vista doesn&#8217;t seem to care as much from what I can tell).Indeed, it works, making the drive go from &#8220;removable&#8221; to &#8220;basic&#8221; (that is, fixed or local).</p>
<p>As I was doing all this in Vista with UAC enabled I was alarmed when it appeared that once I flipped the bit there was no flipping it back!  It&#8217;s not necessarily bad but I prefer to keep it removable unless otherwise necessary.  After lots of flailing (and finding a few posts alluding to this one-way trip problem &#8211; but no answers) <span style="text-decoration: underline;">I ran the utility via the &#8220;Run as administrator&#8221; option</span>. This allowed BootIt to see the &#8220;fixed&#8221; disks (which the flash drive becomes a part of after flipping the bit).  <strong>Be VERY careful not to mess with the wrong drive of course! </strong> I think Vista is more protective of the fixed disks, thus the unexpected hurdle.</p>
<p>Note: I was able to flip the removable bit on Lexar and A-DATA drives, <strong>but I had no luck with</strong> my 4GB OCZ Rally2, a Sandisk Cruzer Micro or with an old Pocket Disk brand 128MB drive (handy for small images) which all stayed resolutely removable.</p>
<p>Read more about the <em><strong>Lexar BootIt (Flip the Removable Media Bit)</strong></em> tool <a href="http://freestickdownload.blogspot.com/2008/05/bootit-lexar-usb-flip-romovable-media.html" target="_blank">here</a> and <a href="http://www.downloadsquad.com/tag/usb-flash-drive/" target="_blank">here</a> (I used v1.07, which I think is the only one out there).</p>
<hr />
<h3>Adding bootable ISO images to UBCD4Win images</h3>
<p>It&#8217;s pretty easy to add bootable ISO images to UBCD4Win (this is tested with v3.22 and should work with v3.50 equally well).  Today I had LOTS of &#8220;fun&#8221; dealing with a lost boot manager on my triple-boot laptop (<em>Vista, Ubuntu, Win7, oh my!</em>) and I snagged copies of <a title="GParted project page" href="http://gparted.sourceforge.net/index.php" target="_blank">GParted</a> and <a title="Super Grub Disk" href="http://www.supergrubdisk.org/" target="_blank">Super Grub</a> to try and save the day.  All I did was download them and add the ISOs to the /images tree on the prepared flash drive.  Then I added a couple of entries in /menu.lst as follows:</p>
<pre>title Super Grub
map --mem (hd0,0)//Images/super_grub.iso (hd32)
map --hook
chainloader (hd32)
rootnoverify (hd32)</pre>
<pre>title GParted
map --mem (hd0,0)//Images/gparted-live.iso (hd32)
map --hook
chainloader (hd32)
rootnoverify (hd32)</pre>
<p>The ISO names must match what&#8217;s in /images, and I&#8217;d avoid putting spaces in the names too.  <span style="color: #800000;"><span style="text-decoration: underline;"><strong>The usual disclaimer applies: I figured this out by trial and error but it worked fine for me.</strong></span></span></p>
<p>Super Grub ended up working and saving the day!  GParted, not so much&#8230; I had to put it on a CD to get it to fully work.  This is no fault of GParted&#8230; as far as I can tell the same problem would affect ANY partition tool. GParted actually got stuck in a repeating loop of attempting to mount a drive and I think it had to do with how the boot process involved resetting the USB hub (thus resetting the flash drive).  Other partition managers that pass through a USB stage also experienced the same issues.  Booting GParted from the CD-RW appears to avoid all that.  I had the same problem when I attemtped to mount and install the Ubuntu 9.04 ISO from that USB drive today&#8230; it worked fine from a DVD.  So, while this method works in theory it may not always be practical given the limitations of booting from USB.</p>
<p>What&#8217;s nice is that once I have a small stable of utilities like this I can eventually burn the whole thing onto a DVD for near-universal usage (even on machines that won&#8217;t boot from flash).  Pretty handy!  <img src='http://www.falatic.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><em><strong>Update: </strong></em>there are better ways to do this menu thing I&#8217;m sure&#8230; and apparently the CD ISO uses an entirely different menu system for some reason.  So at a minimum /BCDW/BCDW.INI also needs to be updated (but I&#8217;m not yet sure what that should look like).</p>
<p><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F7%2Ffun-with-bootable-flash-drives&amp;linkname=Fun%20with%20bootable%20flash%20drives%21" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F7%2Ffun-with-bootable-flash-drives&amp;linkname=Fun%20with%20bootable%20flash%20drives%21" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F7%2Ffun-with-bootable-flash-drives&amp;linkname=Fun%20with%20bootable%20flash%20drives%21" title="Tumblr" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_slashdot" href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F7%2Ffun-with-bootable-flash-drives&amp;linkname=Fun%20with%20bootable%20flash%20drives%21" title="Slashdot" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F7%2Ffun-with-bootable-flash-drives&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F7%2Ffun-with-bootable-flash-drives&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F7%2Ffun-with-bootable-flash-drives&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F7%2Ffun-with-bootable-flash-drives&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F7%2Ffun-with-bootable-flash-drives&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F7%2Ffun-with-bootable-flash-drives&amp;count=horizontal&amp;text=Fun%20with%20bootable%20flash%20drives%21" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F7%2Ffun-with-bootable-flash-drives&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F7%2Ffun-with-bootable-flash-drives&amp;count=horizontal&amp;text=Fun%20with%20bootable%20flash%20drives%21" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F7%2Ffun-with-bootable-flash-drives&amp;title=Fun%20with%20bootable%20flash%20drives%21" id="wpa2a_34"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.falatic.com/index.php/7/fun-with-bootable-flash-drives/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Defender apparent false alarm (Win32/PossibleHostsFileHijack)</title>
		<link>http://www.falatic.com/index.php/5/windows-defender-apparent-false-alarm-win32possiblehostsfilehijack</link>
		<comments>http://www.falatic.com/index.php/5/windows-defender-apparent-false-alarm-win32possiblehostsfilehijack#comments</comments>
		<pubDate>Tue, 10 Mar 2009 07:47:13 +0000</pubDate>
		<dc:creator>Martin Falatic</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Defender]]></category>
		<category><![CDATA[false positive]]></category>
		<category><![CDATA[Win32/PossibleHostsFileHijack]]></category>

		<guid isPermaLink="false">http://www.falatic.com/?p=5</guid>
		<description><![CDATA[I got an alarming popup from Windows Defender tonight: it had detected Win32/PossibleHostsFileHijack in the C:\Windows\System32\drivers\etc\hosts file.  That&#8217;s pretty worrisome and unexpected!  I looked at the file but it seemed uninteresting.  The only non-comment entries were: 127.0.0.1       localhost ::1             localhost &#8230; <a class="more-link" href="http://www.falatic.com/index.php/5/windows-defender-apparent-false-alarm-win32possiblehostsfilehijack">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I got an alarming popup from Windows Defender tonight: it had detected <strong>Win32/PossibleHostsFileHijack</strong> in the <em>C:\Windows\System32\drivers\etc\hosts</em> file.  That&#8217;s pretty worrisome and unexpected!  I looked at the file but it seemed uninteresting.  The only non-comment entries were:</p>
<pre><span style="color: #ff0000;">127.0.0.1       localhost</span>
::1             localhost</pre>
<p><span id="more-5"></span></p>
<p>I made a backup of the file, then I let Defender &#8220;clean&#8221; it.  OK&#8230; it only removed the 127.0.0.1 line (in red above).  Weird: that&#8217;s a pretty standard setting and it doesn&#8217;t seem like it should be going anywhere.</p>
<p>I searched around for this and found <a title="Thread on the Norton forums" href="http://community.norton.com/norton/board/message?board.id=nis_feedback&amp;message.id=37891" target="_blank">this thread on the matter</a>.  I then used Windows update to get the latest version of the Defender database (it was last checked about 18 hours ago) and reverted the &#8220;fix&#8221; Defender had made (in Vista you must edit the <em>hosts </em>file with an editor running in Admin mode&#8230; as always <em>be careful</em>!)  Sure enough, it found and installed a newer version and a re-scan of the <em>hosts </em>file showed&#8230; no problems whatsoever.  Apparently one of Monday&#8217;s Defender definition updates might have had a bug in it.</p>
<p><em>Note: This is NOT to imply this is always a false alarm!  But if the only line that was removed is the standard localhost address as above, update Defender and re-scan.  This &#8220;problem&#8221; may not be a problem after all.</em></p>
<p>Now, I wonder how many people screwed up their <em>hosts</em> file today by letting this rather ubiquitous setting get removed?  I can imagine there are some apps that&#8217;ll be unhappy not to find a localhost route.  If this post helped you avoid some fun config headaches later please drop a quick comment.</p>
<p><strong>Update: <a title="More info" href="http://www.h-online.com/security/Windows-Defender-False-alarm-triggered-by-hosts-file--/news/112814" target="_blank">more info at this site </a>about this issue.</strong></p>
<p><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F5%2Fwindows-defender-apparent-false-alarm-win32possiblehostsfilehijack&amp;linkname=Windows%20Defender%20apparent%20false%20alarm%20%28Win32%2FPossibleHostsFileHijack%29" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F5%2Fwindows-defender-apparent-false-alarm-win32possiblehostsfilehijack&amp;linkname=Windows%20Defender%20apparent%20false%20alarm%20%28Win32%2FPossibleHostsFileHijack%29" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F5%2Fwindows-defender-apparent-false-alarm-win32possiblehostsfilehijack&amp;linkname=Windows%20Defender%20apparent%20false%20alarm%20%28Win32%2FPossibleHostsFileHijack%29" title="Tumblr" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_slashdot" href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F5%2Fwindows-defender-apparent-false-alarm-win32possiblehostsfilehijack&amp;linkname=Windows%20Defender%20apparent%20false%20alarm%20%28Win32%2FPossibleHostsFileHijack%29" title="Slashdot" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F5%2Fwindows-defender-apparent-false-alarm-win32possiblehostsfilehijack&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F5%2Fwindows-defender-apparent-false-alarm-win32possiblehostsfilehijack&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F5%2Fwindows-defender-apparent-false-alarm-win32possiblehostsfilehijack&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F5%2Fwindows-defender-apparent-false-alarm-win32possiblehostsfilehijack&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F5%2Fwindows-defender-apparent-false-alarm-win32possiblehostsfilehijack&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F5%2Fwindows-defender-apparent-false-alarm-win32possiblehostsfilehijack&amp;count=horizontal&amp;text=Windows%20Defender%20apparent%20false%20alarm%20%28Win32%2FPossibleHostsFileHijack%29" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F5%2Fwindows-defender-apparent-false-alarm-win32possiblehostsfilehijack&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F5%2Fwindows-defender-apparent-false-alarm-win32possiblehostsfilehijack&amp;count=horizontal&amp;text=Windows%20Defender%20apparent%20false%20alarm%20%28Win32%2FPossibleHostsFileHijack%29" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F5%2Fwindows-defender-apparent-false-alarm-win32possiblehostsfilehijack&amp;title=Windows%20Defender%20apparent%20false%20alarm%20%28Win32%2FPossibleHostsFileHijack%29" id="wpa2a_36"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.falatic.com/index.php/5/windows-defender-apparent-false-alarm-win32possiblehostsfilehijack/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Vista SP1, WMP11 and Netflix &#8211; a solution</title>
		<link>http://www.falatic.com/index.php/4/vista-sp1-wmp11-and-netflix-a-solution</link>
		<comments>http://www.falatic.com/index.php/4/vista-sp1-wmp11-and-netflix-a-solution#comments</comments>
		<pubDate>Sun, 21 Dec 2008 22:25:02 +0000</pubDate>
		<dc:creator>Martin Falatic</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DRM]]></category>
		<category><![CDATA[Netflix]]></category>
		<category><![CDATA[Vista SP1]]></category>
		<category><![CDATA[Watch Instantly]]></category>
		<category><![CDATA[WMP11]]></category>

		<guid isPermaLink="false">http://www.falatic.com/?p=4</guid>
		<description><![CDATA[I recently upgraded to Windows Vista Business (SP1) from WinXP Pro.  It went relatively well but I was annoyed today when any attempt to use Netflix&#8217;s &#8220;Watch Instantly&#8221; feature from IE 7 caused it to crash! (the &#8220;Indiv01.key&#8221; error). I &#8230; <a class="more-link" href="http://www.falatic.com/index.php/4/vista-sp1-wmp11-and-netflix-a-solution">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently upgraded to Windows Vista Business (SP1) from WinXP Pro.  It went relatively well but I was annoyed today when any attempt to use Netflix&#8217;s &#8220;Watch Instantly&#8221; feature from IE 7 caused it to crash! (the &#8220;Indiv01.key&#8221; error).</p>
<p><span id="more-4"></span></p>
<p>I did some searching&#8230; turns out there are lots of complaints out there about this sort of issue, but almost nobody posted the correct way to fix it when Vista SP1 and WMP11 are involved.  Most solutions revolved around WMP10 or earlier.  The problem is, for some bizarre reason you can&#8217;t manage your licenses in WMP11 (there is no menu item for it and apparently all backup/restore functionality is gone!)  Why?  I have no idea.  Glad I don&#8217;t depend on it for anything else!</p>
<p>I uninstalled and reinstalled Netflix&#8230; didn&#8217;t help.  Lots of suggestions out there to downgrade WMP11 to 10 or such, but those are fraught with caveats.  Reinstall Vista?  Right!  When my furnace won&#8217;t work I don&#8217;t repaint the living room and redecorate the bedrooms&#8230; why should one rebuild the whole system for an isolated failure?  Besides, apparently that doesn&#8217;t help either.</p>
<p><strong>Finally, I stumbled across a useful answer!</strong> Close IE and run the following command.  CAVEAT: supposedly it resets ALL your DRM license info&#8230; beware!  That wasn&#8217;t a concern for me (I&#8217;m wary of buying any DRM-wrapped media that could evaporate on a whim) but it could be an issue for you.  The command is:</p>
<p><strong>C:\Program Files\<span class="hilite">Netflix</span>\<span class="hilite">Netflix</span> Movie Viewer\ResetDRM.exe</strong></p>
<p>After a couple of warning windows (read them carefully!) it completed.  I reopened IE, clicked play on a Netflix movie and instead of crashing it notified me it needed to update something in WMP (as it had done long ago in XP).  I let it, and after that it works like a charm!</p>
<p>Well, almost&#8230; looks like it&#8217;ll complain about getting a license every time you use it (because of IE&#8217;s &#8220;protected mode&#8221;?  I dunno but I don&#8217;t feel safe to disable it).  It seems to work after a prompt, but it makes me think it&#8217;ll eventually fail again.</p>
<p><strong>Was all this work worth it though? </strong>We&#8217;ll see&#8230; I don&#8217;t trust that it&#8217;ll be reliable and if it wasn&#8217;t free as part of my Netflix membership I would be very hesitant to use this at all &#8211; especially when such DRM &#8220;rights&#8221; could suddenly disappear tomorrow or, as we see here, every time you use it.  DRM is nothing but a nightmare and apparently it&#8217;s only getting worse.  I&#8217;d go to Blu-Ray but I don&#8217;t want any &#8220;Surprise!  DRM doesn&#8217;t like your big new monitor!&#8221; problems (also reported, which HDCP compatibility supposedly helps but it&#8217;s a &#8220;gotcha!&#8221; I don&#8217;t care to risk right now).</p>
<p><strong>References:</strong></p>
<p><a href="http://www.annoyances.org/exec/forum/winvista/t1201447823" target="_blank">http://www.annoyances.org/exec/forum/winvista/t1201447823</a></p>
<p><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F4%2Fvista-sp1-wmp11-and-netflix-a-solution&amp;linkname=Vista%20SP1%2C%20WMP11%20and%20Netflix%20%26%238211%3B%20a%20solution" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F4%2Fvista-sp1-wmp11-and-netflix-a-solution&amp;linkname=Vista%20SP1%2C%20WMP11%20and%20Netflix%20%26%238211%3B%20a%20solution" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F4%2Fvista-sp1-wmp11-and-netflix-a-solution&amp;linkname=Vista%20SP1%2C%20WMP11%20and%20Netflix%20%26%238211%3B%20a%20solution" title="Tumblr" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_slashdot" href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F4%2Fvista-sp1-wmp11-and-netflix-a-solution&amp;linkname=Vista%20SP1%2C%20WMP11%20and%20Netflix%20%26%238211%3B%20a%20solution" title="Slashdot" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F4%2Fvista-sp1-wmp11-and-netflix-a-solution&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F4%2Fvista-sp1-wmp11-and-netflix-a-solution&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F4%2Fvista-sp1-wmp11-and-netflix-a-solution&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F4%2Fvista-sp1-wmp11-and-netflix-a-solution&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F4%2Fvista-sp1-wmp11-and-netflix-a-solution&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F4%2Fvista-sp1-wmp11-and-netflix-a-solution&amp;count=horizontal&amp;text=Vista%20SP1%2C%20WMP11%20and%20Netflix%20%26%238211%3B%20a%20solution" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F4%2Fvista-sp1-wmp11-and-netflix-a-solution&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F4%2Fvista-sp1-wmp11-and-netflix-a-solution&amp;count=horizontal&amp;text=Vista%20SP1%2C%20WMP11%20and%20Netflix%20%26%238211%3B%20a%20solution" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F4%2Fvista-sp1-wmp11-and-netflix-a-solution&amp;title=Vista%20SP1%2C%20WMP11%20and%20Netflix%20%26%238211%3B%20a%20solution" id="wpa2a_38"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.falatic.com/index.php/4/vista-sp1-wmp11-and-netflix-a-solution/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blog #2: The Quickening</title>
		<link>http://www.falatic.com/index.php/3/blog-2-the-quickening</link>
		<comments>http://www.falatic.com/index.php/3/blog-2-the-quickening#comments</comments>
		<pubDate>Sun, 07 Oct 2007 07:52:55 +0000</pubDate>
		<dc:creator>Martin Falatic</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.falatic.com/?p=3</guid>
		<description><![CDATA[Ok, not-so-quick considering the time since I wrote the last one. What all does one write on a blog that&#8217;s purposely sanitized so it won&#8217;t offend past, present or future employers? Something intended to be neutral and unassuming? Frankly not &#8230; <a class="more-link" href="http://www.falatic.com/index.php/3/blog-2-the-quickening">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ok, not-so-quick considering the time since I wrote the last one.</p>
<p>What all does one write on a blog that&#8217;s purposely sanitized so it won&#8217;t offend past, present or future employers? Something intended to be neutral and unassuming? Frankly not a heck of a lot.</p>
<p>*Sigh*</p>
<p><a class="a2a_button_reddit" href="http://www.addtoany.com/add_to/reddit?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F3%2Fblog-2-the-quickening&amp;linkname=Blog%20%232%3A%20The%20Quickening" title="Reddit" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/reddit.png" width="16" height="16" alt="Reddit"/></a><a class="a2a_button_linkedin" href="http://www.addtoany.com/add_to/linkedin?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F3%2Fblog-2-the-quickening&amp;linkname=Blog%20%232%3A%20The%20Quickening" title="LinkedIn" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/linkedin.png" width="16" height="16" alt="LinkedIn"/></a><a class="a2a_button_tumblr" href="http://www.addtoany.com/add_to/tumblr?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F3%2Fblog-2-the-quickening&amp;linkname=Blog%20%232%3A%20The%20Quickening" title="Tumblr" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/tumblr.png" width="16" height="16" alt="Tumblr"/></a><a class="a2a_button_slashdot" href="http://www.addtoany.com/add_to/slashdot?linkurl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F3%2Fblog-2-the-quickening&amp;linkname=Blog%20%232%3A%20The%20Quickening" title="Slashdot" rel="nofollow" target="_blank"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/icons/slashdot.png" width="16" height="16" alt="Slashdot"/></a><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F3%2Fblog-2-the-quickening&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service google_plusone" src="https://plusone.google.com/u/0/_/%2B1/fastbutton?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F3%2Fblog-2-the-quickening&amp;size=medium&amp;count=true" scrolling="no" style="border:none;overflow:hidden;width:90px;height:20px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F3%2Fblog-2-the-quickening&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service facebook_like" src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F3%2Fblog-2-the-quickening&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=like&amp;colorscheme=light&amp;height=20&amp;ref=addtoany" scrolling="no" style="border:none;overflow:hidden;width:90px;height:21px"></iframe><!--<![endif]--><!--[if IE]><iframe frameborder="0" allowTransparency="true" class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F3%2Fblog-2-the-quickening&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F3%2Fblog-2-the-quickening&amp;count=horizontal&amp;text=Blog%20%232%3A%20The%20Quickening" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><![endif]--><!--[if !IE]><!--><iframe class="addtoany_special_service twitter_tweet" src="http://platform.twitter.com/widgets/tweet_button.html?url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F3%2Fblog-2-the-quickening&amp;counturl=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F3%2Fblog-2-the-quickening&amp;count=horizontal&amp;text=Blog%20%232%3A%20The%20Quickening" scrolling="no" style="border:none;overflow:hidden;width:130px;height:20px"></iframe><!--<![endif]--><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.falatic.com%2Findex.php%2F3%2Fblog-2-the-quickening&amp;title=Blog%20%232%3A%20The%20Quickening" id="wpa2a_40"><img src="http://www.falatic.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.falatic.com/index.php/3/blog-2-the-quickening/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

