<?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>Greg Fiumara</title>
	<atom:link href="http://blog.gregfiumara.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.gregfiumara.com</link>
	<description>Ramblings about life, technology, and the real world</description>
	<lastBuildDate>Sun, 22 Aug 2010 03:20:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Get latest tweet without API key in PHP</title>
		<link>http://blog.gregfiumara.com/?p=94</link>
		<comments>http://blog.gregfiumara.com/?p=94#comments</comments>
		<pubDate>Sun, 22 Aug 2010 03:07:43 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[tweet]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.gregfiumara.com/?p=94</guid>
		<description><![CDATA[I&#8217;ve been working on a backend for a website and needed a way to show the latest Twitter update. There is plenty of code floating around that does this, but I couldn&#8217;t find anything simple that preserved formatting, like hyperlinks to @replies, e-mail addresses, URLs, etc. Anything that did was either very bulky (lots of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on a backend for a website and needed a way to show the latest Twitter update.  There is plenty of code floating around that does this, but I couldn&#8217;t find anything <em>simple</em> that <strong>preserved formatting</strong>, like hyperlinks to @replies, e-mail addresses, URLs, etc.  Anything that did was either very bulky (lots of source files) or required a Twitter API key&#8230;so I wrote my own, self-contained in a single function call.<br />
<span id="more-94"></span><br />
As you can see, this just scrubs the HTML from Twitter.com, so it definitely could break without notice.  That&#8217;s what you get for not using the official API, you should expect that.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> latest_tweet<span style="color: #009900;">&#40;</span><span style="color: #000088;">$username</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'gfiumara'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$include_date</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">/* Grab the latest tweet in XML format */</span>
        <span style="color: #000088;">$twitter_feed_url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://twitter.com/statuses/user_timeline/<span style="color: #006699; font-weight: bold;">$username</span>.xml?count=1&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$feed_buffer</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$twitter_feed_url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">/* Use the tweet ID from XML to retrieve an HTML page with the tweet */</span>
        <span style="color: #000088;">$xml</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SimpleXMLElement<span style="color: #009900;">&#40;</span><span style="color: #000088;">$feed_buffer</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$status</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$xml</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">status</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$single_tweet_url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://twitter.com/<span style="color: #006699; font-weight: bold;">$username</span>/status/<span style="color: #006699; font-weight: bold;">$status-&gt;id</span>&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$html_buffer</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$single_tweet_url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">/* Tweets are located in an 'entry-content' class span */</span>
        <span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'`&lt;span class=&quot;entry-content&quot;&gt;(?P&lt;latest&gt;.*)&lt;/span&gt;`'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$html_buffer</span><span style="color: #339933;">,</span> <span style="color: #000088;">$tweet_array</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">/* Add some additional formatting */</span>
        <span style="color: #000088;">$tweet</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;div id=&quot;tweet&quot;&gt;@&lt;a href=&quot;http://www.twitter.com/'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$username</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$username</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/a&gt;: '</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tweet_array</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'latest'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$tweet</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$tweet_array</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'latest'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #666666; font-style: italic;">/* Twitter uses relative links for @replies, etc. */</span>
                <span style="color: #000088;">$tweet</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'`href=&quot;/`'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'href=&quot;http://twitter.com/'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$tweet</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
                <span style="color: #666666; font-style: italic;">/* Insert the date */</span>
                <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$include_date</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #666666; font-style: italic;">/* Date is located in a 'published timestamp' span */</span>
                        <span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'`&lt;span class=&quot;published timestamp&quot; .*&gt;(?P&lt;latest&gt;.*)&lt;/span&gt;`'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$html_buffer</span><span style="color: #339933;">,</span> <span style="color: #000088;">$date_array</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$date_array</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'latest'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> 
                                <span style="color: #666666; font-style: italic;">/* Don't use HTML5 &lt;time&gt; because we're not guaranteed a valid time string */</span>
                                <span style="color: #000088;">$tweet</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;a href=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$single_tweet_url</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot; target=&quot;_blank&quot;&gt;&lt;div class=&quot;time&quot;&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$date_array</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'latest'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&lt;/div&gt;&lt;/a&gt;&quot;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span>
                <span style="color: #000088;">$tweet</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;&lt;em&gt;No tweet retrieved.&lt;/em&gt;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$tweet</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&lt;/div&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>That said, this would be infinitely easier with <a href="http://www.jquery.com/">jQuery</a> or an <a href="http://simplehtmldom.sourceforge.net/">HTML DOM Parser</a>, but I really wanted it to be self-contained and completely PHP.  You&#8217;ll need PHP 5 to use this code.  If you&#8217;re stuck with PHP 4, you could simply rewrite the <a href="http://www.php.net/manual/en/book.simplexml.php">SimpleXML</a> section with <a href="http://www.php.net/manual/en/book.domxml.php">DOM XML</a> or parse it with <a href="http://php.net/manual/en/function.preg-match.php">preg_match()</a> like I do to get the date.  You might want to <a href="http://php.net/manual/en/function.preg-quote.php">preg_quote()</a> the regular expressions.</p>
<p>If you see how this can be improved in any way or you spend the time to make it work for PHP 4, please leave a comment!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gregfiumara.com/?feed=rss2&amp;p=94</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Starting an Android Service at Device Boot</title>
		<link>http://blog.gregfiumara.com/?p=82</link>
		<comments>http://blog.gregfiumara.com/?p=82#comments</comments>
		<pubDate>Mon, 05 Jul 2010 22:12:36 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[boot]]></category>
		<category><![CDATA[broadcastreceiver]]></category>
		<category><![CDATA[intent]]></category>
		<category><![CDATA[manifest]]></category>
		<category><![CDATA[service]]></category>
		<category><![CDATA[start]]></category>

		<guid isPermaLink="false">http://blog.gregfiumara.com/?p=82</guid>
		<description><![CDATA[I haven&#8217;t been messing around with the Android SDK for too long but I&#8217;ve already found some things that I think are worth sharing. Android has a concept of Services, or a process that can sit in the background and run a task without needing to interact with the user. There&#8217;s plenty of reasons why [...]]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t been messing around with the <a href="http://developer.android.com/index.html">Android SDK</a> for too long but I&#8217;ve already found some things that I think are worth sharing.  Android has a concept of <a href="http://developer.android.com/reference/android/app/Service.html"><tt>Services</tt></a>, or a process that can sit in the background and run a task without needing to interact with the user.  There&#8217;s plenty of reasons why a <tt>Service</tt> might not need to be running all the time (say an alarm clock app with no alarms scheduled), but for the most part, <tt>Services</tt> need to be started at boot.  Here&#8217;s how, tested from Android 1.5 to 2.2, since no other example I could find on the Internet was complete for this ever-changing SDK.<br />
<span id="more-82"></span><br />
This example <tt>Service</tt>, <tt>StartAtBootService</tt>, is a member of the package <tt>com.example.ssab</tt> (StartServiceAtBoot):  <b>Be careful with your <tt>Service</tt> implementation, as the <tt>onStart()</tt> method is depreciated in newer versions of the SDK!</b></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.app.Service</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.content.Intent</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.os.IBinder</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.util.Log</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> StartAtBootService <span style="color: #000000; font-weight: bold;">extends</span> Service 
<span style="color: #009900;">&#123;</span>
	    <span style="color: #000000; font-weight: bold;">public</span> IBinder onBind<span style="color: #009900;">&#40;</span>Intent intent<span style="color: #009900;">&#41;</span>
	    <span style="color: #009900;">&#123;</span>
	    	<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span>
&nbsp;
	    @Override
	    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onCreate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
	    <span style="color: #009900;">&#123;</span>
	    	Log.<span style="color: #006633;">v</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;StartServiceAtBoot&quot;</span>, <span style="color: #0000ff;">&quot;StartAtBootService Created&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span>
&nbsp;
	    @Override
	    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">int</span> onStartCommand<span style="color: #009900;">&#40;</span>Intent intent, <span style="color: #000066; font-weight: bold;">int</span> flags, <span style="color: #000066; font-weight: bold;">int</span> startId<span style="color: #009900;">&#41;</span> 
	    <span style="color: #009900;">&#123;</span>
	    	Log.<span style="color: #006633;">v</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;StartServiceAtBoot&quot;</span>, <span style="color: #0000ff;">&quot;StartAtBootService -- onStartCommand()&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	        
&nbsp;
	        <span style="color: #666666; font-style: italic;">// We want this service to continue running until it is explicitly</span>
	        <span style="color: #666666; font-style: italic;">// stopped, so return sticky.</span>
	        <span style="color: #000000; font-weight: bold;">return</span> START_STICKY<span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span>
&nbsp;
	    <span style="color: #666666; font-style: italic;">/*
	     * In Android 2.0 and later, onStart() is depreciated.  Use
	     * onStartCommand() instead, or compile against API Level 5 and
	     * use both.
	     * http://android-developers.blogspot.com/2010/02/service-api-changes-starting-with.html
	    	@Override
	    	public void onStart(Intent intent, int startId)
	    	{
	    		Log.v(&quot;StartServiceAtBoot&quot;, &quot;StartAtBootService -- onStart()&quot;);	        
	    	}
	     */</span>
&nbsp;
	    @Override
	    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onDestroy<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
	    <span style="color: #009900;">&#123;</span>
	    	Log.<span style="color: #006633;">v</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;StartServiceAtBoot&quot;</span>, <span style="color: #0000ff;">&quot;StartAtBootService Destroyed&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Use any <tt>Service</tt> you already have instead of the above.  Within <tt>application</tt> in your <tt>AndroidManifest.xml</tt> define your <tt>Service</tt> <b>with an <tt>intent-filter</tt></b>:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;StartAtBootService&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;intent-filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;com.example.ssab.StartAtBootService&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/action<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/intent-filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Now the new part.  The OS broadcasts <tt>ACTION_BOOT_COMPLETED</tt> when it has finished booting.  Your app can ask to receive this notification by requesting permission in your manifest:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;uses-permission</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;android.permission.RECEIVE_BOOT_COMPLETED&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/uses-permission<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Your app now gets the broadcast, but still needs to do something with it.  This is done by subclassing the <tt>BroadcastReceiver</tt> class.  As far as I know, <tt>ACTION_BOOT_COMPLETED</tt> is the only <tt>Intent</tt> broadcast to apps, but because this could change at any point (and I can all but guarantee it will), do yourself a favor and check the <tt>Intent</tt> in your <tt>onReceive()</tt> method:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.content.BroadcastReceiver</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.content.Context</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">android.content.Intent</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> StartAtBootServiceReceiver <span style="color: #000000; font-weight: bold;">extends</span> BroadcastReceiver 
<span style="color: #009900;">&#123;</span>
	@Override
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onReceive<span style="color: #009900;">&#40;</span><span style="color: #003399;">Context</span> context, Intent intent<span style="color: #009900;">&#41;</span> 
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>intent.<span style="color: #006633;">getAction</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>Intent.<span style="color: #006633;">ACTION_BOOT_COMPLETED</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			Intent i <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Intent<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			i.<span style="color: #006633;">setAction</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;com.example.ssab.StartAtBootService&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			context.<span style="color: #006633;">startService</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The last thing you need to do is register your <tt>BroadcastReceiver</tt> in your manifest, <b>within <tt>application</tt></b>:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;receiver</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;StartAtBootServiceReceiver&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;intent-filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;action</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;android.intent.action.BOOT_COMPLETED&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/action<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;category</span> <span style="color: #000066;">android:name</span>=<span style="color: #ff0000;">&quot;android.intent.category.HOME&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/category<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/intent-filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/receiver<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>That should do it.  If you&#8217;re using Eclipse, run your app once and then exit the emulator.  Then issue <tt>emulator -avd <i>your_avd_name</i></tt> to launch your emulator without uninstalling your app.  An <tt>adb logcat | grep StartAtBootService</tt> should show your app starting at boot.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gregfiumara.com/?feed=rss2&amp;p=82</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using iAds While Maintaining Backwards Compatibility</title>
		<link>http://blog.gregfiumara.com/?p=68</link>
		<comments>http://blog.gregfiumara.com/?p=68#comments</comments>
		<pubDate>Sun, 27 Jun 2010 17:36:59 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[iad]]></category>
		<category><![CDATA[ios 4]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[weak link]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://blog.gregfiumara.com/?p=68</guid>
		<description><![CDATA[iAds are going to be all over apps in the AppStore in just a few short weeks as developers try to make some money from the average iPhone user. The only problem is that you won&#8217;t make any money unless the user is running iOS 4.0. Versions of the iOS prior to this don&#8217;t have [...]]]></description>
			<content:encoded><![CDATA[<p>iAds are going to be all over apps in the AppStore in just a few short weeks as developers try to make some money from the average iPhone user.  The only problem is that you won&#8217;t make <strong>any</strong> money unless the user is running iOS 4.0.  Versions of the iOS prior to this don&#8217;t have the iAd framework and therefore can&#8217;t display ads.  So what&#8217;s a developer who wants a few clams to do?<br />
<span id="more-68"></span><br />
Here&#8217;s my suggestion if you&#8217;re <em>really</em> that concerned about making money:</p>
<ul>
<li>Target your app at iOS 3 (unless your analytics show heavy iOS 2 usage, it&#8217;s time to leave them).</li>
<li>Limit a few &#8220;pro&#8221; features in the iOS 3 version that can be unlocked with a minimal in-app purchase.</li>
<li>Once your app is ready, <a title="Framework Programming Guide - Weak Linking" href="http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html" target="_blank">weak link</a> the iAd framework, enable iAds in your app, and use <em>intelligent</em> conditional checks when writing iAd code.</li>
</ul>
<p>Hopefully since you&#8217;re choosing to use ads while under iOS 4, you won&#8217;t charge to download your app and all features of your app will be unlocked when displaying ads.  It still might be appropriate to create an in-app purchase that disables advertisements.  Just don&#8217;t take advantage of your users to line your pockets.</p>
<p>Unfortunately, you can&#8217;t use Interface Builder to add the <tt>ADBannerView</tt> object so you must generate the element programmatically.  Remember to weak link the iAd framework by selecting the appropriate target in the Groups and Files pane and then change &#8220;Required&#8221; to &#8220;Weak&#8221; for iAd.</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">/* YourViewController.h */</span>
<span style="color: #6e371a;">#import &lt;iAd/iAd.h&gt;</span>
&nbsp;
<span style="color: #a61390;">@interface</span> YourViewController <span style="color: #002200;">:</span> UIViewController
<span style="color: #002200;">&#123;</span>
	ADBannerView <span style="color: #002200;">*</span>adView;
	<span style="color: #a61390;">BOOL</span> bannerIsVisible;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #a61390;">@property</span><span style="color: #002200;">&#40;</span>nonatomic, retain<span style="color: #002200;">&#41;</span> ADBannerView <span style="color: #002200;">*</span>adView;
<span style="color: #a61390;">@property</span><span style="color: #002200;">&#40;</span>nonatomic, assign<span style="color: #002200;">&#41;</span> <span style="color: #a61390;">BOOL</span> bannerIsVisible;
&nbsp;
<span style="color: #11740a; font-style: italic;">/* YourViewController.m */</span>
<span style="color: #a61390;">@synthesize</span> adView;
<span style="color: #a61390;">@synthesize</span> bannerIsVisible;
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>viewDidLoad
<span style="color: #002200;">&#123;</span>
	<span style="color: #002200;">&#91;</span>super viewDidLoad<span style="color: #002200;">&#93;</span>;
&nbsp;
	<span style="color: #a61390;">static</span> <span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span> <span style="color: #a61390;">const</span> kADBannerViewClass <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;ADBannerView&quot;</span>;
	<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>NSClassFromString<span style="color: #002200;">&#40;</span>kADBannerViewClass<span style="color: #002200;">&#41;</span> <span style="color: #002200;">!=</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
		<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>self.adView <span style="color: #002200;">==</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
			self.adView <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>ADBannerView alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;
			self.adView.delegate <span style="color: #002200;">=</span> self;
			self.adView.frame <span style="color: #002200;">=</span> CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #002200;">-</span><span style="color: #2400d9;">50</span>, <span style="color: #2400d9;">320</span>, <span style="color: #2400d9;">50</span><span style="color: #002200;">&#41;</span>;
			self.adView.currentContentSizeIdentifier <span style="color: #002200;">=</span> ADBannerContentSizeIdentifier320x50;
			<span style="color: #002200;">&#91;</span>self.view addSubview<span style="color: #002200;">:</span>self.adView<span style="color: #002200;">&#93;</span>;
		<span style="color: #002200;">&#125;</span>
	<span style="color: #002200;">&#125;</span>
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #6e371a;">#pragma mark -</span>
<span style="color: #6e371a;">#pragma mark ADBannerViewDelegate Methods</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>bannerViewDidLoadAd<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>ADBannerView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>banner
<span style="color: #002200;">&#123;</span>
	<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">!</span>self.bannerIsVisible<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
		<span style="color: #002200;">&#91;</span>UIView beginAnimations<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span> context<span style="color: #002200;">:</span><span style="color: #a61390;">NULL</span><span style="color: #002200;">&#93;</span>;
		banner.frame <span style="color: #002200;">=</span> CGRectOffset<span style="color: #002200;">&#40;</span>banner.frame, <span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">50</span><span style="color: #002200;">&#41;</span>;
		<span style="color: #002200;">&#91;</span>UIView commitAnimations<span style="color: #002200;">&#93;</span>;
		self.bannerIsVisible <span style="color: #002200;">=</span> <span style="color: #a61390;">YES</span>;
	<span style="color: #002200;">&#125;</span>
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>bannerView<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>ADBannerView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>banner didFailToReceiveAdWithError<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSError</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>error
<span style="color: #002200;">&#123;</span>
	<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>self.bannerIsVisible<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
		<span style="color: #002200;">&#91;</span>UIView beginAnimations<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span> context<span style="color: #002200;">:</span><span style="color: #a61390;">NULL</span><span style="color: #002200;">&#93;</span>;
		banner.frame <span style="color: #002200;">=</span> CGRectOffset<span style="color: #002200;">&#40;</span>banner.frame, <span style="color: #2400d9;">0</span>, <span style="color: #002200;">-</span><span style="color: #2400d9;">50</span><span style="color: #002200;">&#41;</span>;
		<span style="color: #002200;">&#91;</span>UIView commitAnimations<span style="color: #002200;">&#93;</span>;
		self.bannerIsVisible <span style="color: #002200;">=</span> <span style="color: #a61390;">NO</span>;
	<span style="color: #002200;">&#125;</span>
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>dealloc
<span style="color: #002200;">&#123;</span>
	self.adView.delegate <span style="color: #002200;">=</span> <span style="color: #a61390;">nil</span>
	self.adView <span style="color: #002200;">=</span> <span style="color: #a61390;">nil</span>;
&nbsp;
	<span style="color: #002200;">&#91;</span>super dealloc<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<div id="attachment_69" class="wp-caption aligncenter" style="width: 328px"><a href="http://blog.gregfiumara.com/wp-content/uploads/2010/06/weaklinkiad.png"><img class="size-full wp-image-69" title="Weak Linking iAd Framework" src="http://blog.gregfiumara.com/wp-content/uploads/2010/06/weaklinkiad.png" alt="Weak Linking iAd Framework" width="318" height="96" /></a><p class="wp-caption-text">Don&#39;t forget to weak link the iAd framework!</p></div>
<p>Nothing special needs to be done about your interface file (.h).  Think about it: at compile time, the preprocessor directive importing the iAd interface defines the interface <tt>ADBannerView</tt>.  Because we weak link the framework, the compiler won&#8217;t complain about the implementation not being around for the 3.0 target.  You also don&#8217;t need to worry about doing checks for the <tt>ADBannerView</tt> class in the delegate methods, they&#8217;ll only get called if adView is instantiated and sets <tt>YourViewController</tt> as the <tt>delegate</tt>.</p>
<p>Remember to set your <strong>Base SDK</strong> for to iOS 4 and your <strong>Deployment Target</strong> to the lowest iOS version you want to support, or you did all this for naught.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gregfiumara.com/?feed=rss2&amp;p=68</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>MultiDetailView</title>
		<link>http://blog.gregfiumara.com/?p=61</link>
		<comments>http://blog.gregfiumara.com/?p=61#comments</comments>
		<pubDate>Sat, 03 Apr 2010 14:42:09 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[3.2]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[MultiDetailView]]></category>
		<category><![CDATA[NDA]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Protocols]]></category>
		<category><![CDATA[UISplitViewController]]></category>

		<guid isPermaLink="false">http://blog.gregfiumara.com/?p=61</guid>
		<description><![CDATA[UPDATE: Well, glad I spent the time preparing this&#8230;Apple decided to post it on their site&#8230; Happy iPad release day! Now that the iPad NDA has been been lifted, there are a lot of topics I&#8217;d like to write about. iPhone OS 3.2 brings about several new features including a new UIViewController called UISplitViewController. This [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE: </strong>Well, glad I spent the time preparing this&#8230;Apple <a href="http://developer.apple.com/iphone/library/samplecode/MultipleDetailViews/Introduction/Intro.html">decided to post it</a> on their site&#8230;</p>
<hr />
Happy iPad release day!  Now that the iPad NDA has been been lifted, there are a lot of topics I&#8217;d like to write about.  iPhone OS 3.2 brings about several new features including a new UIViewController called <a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UISplitViewController_class/index.html">UISplitViewController</a>.  This allows you to, in landscape orientation, have two UIViewContollers side-by-side.  On device rotation to portrait orientation, the left-most UIViewController (the &#8220;rootViewController&#8221;) disappears from view and is replaced by a UIBarButtonItem in the right-most UIViewController (the &#8220;detailViewController&#8221;).<span id="more-61"></span>By default, you can only change the contents of the UIViewControllers in the UISplitViewController, but what if you want to swap in a completely different UIViewController to the detailViewController?  There are countless iPad apps on the store right now that are doing this, from <a href="http://itunes.apple.com/us/app/twitterrific-for-ipad/id359914600?mt=8">Twitterific</a> to <a href="http://itunes.apple.com/us/app/picture-sleuth/id363322766?mt=8">Picture Sleuth</a> (<em>shameless plug</em>).  There must have been at least 8 different threads on the <a href="http://devforums.apple.com">Apple Developer Forums</a> about how to do this during the iPhone OS 3.2 NDA period, with Apple (mmalc) providing pretty good tips using <a href="http://developer.apple.com/mac/library/documentation/cocoa/conceptual/ObjectiveC/Articles/ocProtocols.html">Objective-C protocols</a>.  People still couldn&#8217;t follow it, so I implemented it and posted it to the Forum.</p>
<p>I&#8217;m sure other examples will be flooding the Internet soon, as I&#8217;ve seen some questions regarding my initial posted asked on Stack Overflow.  Now that the NDA is lifted, you can <a href="http://blog.gregfiumara.com/wp-content/uploads/2010/04/MultiDetailView.zip">download the example project</a> (with few additional comments and clean-up).</p>
<p>You&#8217;ll mainly want to familiarize yourself with RootViewController.m&#8217;s UITableViewDelegate methods and the SubstitutableDetailViewController protocol.  I&#8217;ve removed a lot of unused methods for readability, so you probably shouldn&#8217;t be using this as a starting template but rather a learning tool.  We&#8217;re able to swap in multiple detailViewControllers by manipulating the <a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UISplitViewController_class/Reference/Reference.html#//apple_ref/occ/instp/UISplitViewController/viewControllers">viewControllers property</a> of the UISplitViewController.  This is more of a lesson in Objective-C protocols than anything, so if you&#8217;re in need of this code, you probably should be reading and understanding the <a href="http://developer.apple.com/mac/library/documentation/cocoa/conceptual/ObjectiveC/Articles/ocProtocols.html">Objective-C documentation on protocols</a> from Apple <em>first</em>.</p>
<p>There are several other ways to do this (<a href="http://itunes.apple.com/us/app/picture-sleuth/id363322766?mt=8">Picture Sleuth </a>uses a different method) but it all boils down to the same stuff.</p>
<p><a href="http://blog.gregfiumara.com/wp-content/uploads/2010/04/MultiDetailView.zip">Download the example project.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gregfiumara.com/?feed=rss2&amp;p=61</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Application cannot be executed.  The file  is infected.</title>
		<link>http://blog.gregfiumara.com/?p=54</link>
		<comments>http://blog.gregfiumara.com/?p=54#comments</comments>
		<pubDate>Fri, 19 Mar 2010 17:01:19 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[combofix]]></category>
		<category><![CDATA[computer science]]></category>
		<category><![CDATA[malware]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[tech support]]></category>
		<category><![CDATA[virus]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.gregfiumara.com/?p=54</guid>
		<description><![CDATA[One of the worst things about being a &#8220;tech guy&#8221; to non-technical people is that you are constantly bombarded with questions or favors and you feel obliged to give in a large amount of the time.  It&#8217;s even worse when the knowledge of your &#8220;skill&#8221; is spread to friends and neighbors of your friends whom [...]]]></description>
			<content:encoded><![CDATA[<p>One of the worst things about being a &#8220;tech guy&#8221; to non-technical people is that you are constantly <a title="The Oatmeal" href="http://theoatmeal.com/comics/computers" target="_blank">bombarded with questions or favors</a> and you feel obliged to give in a large amount of the time.  It&#8217;s even worse when the knowledge of your &#8220;skill&#8221; is spread to friends and neighbors of your friends whom you don&#8217;t even know.  Most of the time, especially recently (being unemployed), I don&#8217;t so much mind helping out but people definitely take advantage.<span id="more-54"></span></p>
<p>This happened today.  My dad&#8217;s friend calls me to let me know that his &#8220;brand new computer&#8221; is popping up the message &#8220;Application cannot be executed. The file wuauclt.exe is infected. Do you want to activate your antivirus software now?&#8221;  Followed by ads for a $70 product and his computer unable to do anything but display that message.  I offered to Google for him and print out the information but I knew he wanted me to make a house call, and 45 minutes later I was there, armed with 20 minutes worth of Googling.</p>
<p>Here&#8217;s how to fix your problem if you have it, since there really isn&#8217;t a good resource on Google.  But I&#8217;m also going to rant.  Also, if you stumble across this post because you&#8217;re having this problem and this solution doesn&#8217;t work for you, please move along.</p>
<ol>
<li>Boot into safe mode</li>
<li>Launch Internet Explorer
<ul>
<li>Of course you only go to trusted websites and read e-mails from people you know.  Yet, here I am trying to fix your machine.</li>
</ul>
</li>
<li><a title="IE Proxy" href="http://windows.microsoft.com/en-US/windows-vista/Change-proxy-settings-in-Internet-Explorer" target="_blank">Remove the fake proxy</a> from IE
<ul>
<li>On the machine I was fixing, it was connecting to localhost:5555</li>
<li>If you actually <strong>do</strong> use a proxy to connect to the Internet, replace the fake proxy with the correct information.  If you don&#8217;t know what a proxy is, you probably don&#8217;t use one!</li>
</ul>
</li>
<li>Run <a title="ComboFix" href="http://www.combofix.org/" target="_blank">ComboFix</a>
<ul>
<li>Really all you <em>need</em> to do is remove %userprofile%\Local Settings\Application Settings\&lt;random 4-6&gt;\&lt;different_random&gt;.exe but you probably have other malware and ComboFix will take care of some of it.</li>
</ul>
</li>
<li>Reboot and read the rest of my post
<ul>
<li>Your problem is solved for now, but a proper anti-virus tool will remove orphaned files from this malware (once they get updated).</li>
</ul>
</li>
</ol>
<p>There are a few things I think every Windows user ought to be required to know and do before they can use their machines.  This would eliminate over 50% of tech support calls, reducing the need to outsource tech support to India, increasing the number of US jobs.  There, I just solved the &#8220;<a href="http://www.washingtonpost.com/wp-dyn/content/article/2010/03/17/AR2010031703537.html" target="_blank">jobs crisis</a>&#8221; for a lot less.</p>
<ul>
<li>Don&#8217;t use Internet Explorer (use <a title="Firefox" href="http://www.firefox.com/" target="_blank">Firefox</a> or <a title="Google Chrome" href="http://www.google.com/chrome" target="_blank">Chrome</a> instead)
<ul>
<li>You wouldn&#8217;t take tour of the White House from the bum who sleeps out on the National Mall, this is no different.</li>
</ul>
</li>
<li>Turn on <a title="Enabling Windows Updates" href="http://www.microsoft.com/security/updates/mu.aspx" target="_blank">Windows Automatic Updates</a> and <a title="Enable Windows Firewall" href="http://windows.microsoft.com/en-US/windows-vista/Turn-Windows-Firewall-on-or-off" target="_blank">Windows Firewall</a>
<ul>
<li>Microsoft actually tries to do a decent job trying to protect you when they can, but most users don&#8217;t let them.</li>
</ul>
</li>
<li>Download and automatically update <em>nightly</em> <strong>one</strong> <a title="AVG Free" href="http://free.avg.com/" target="_blank">respectable</a> <a title="Avast!  Free" href="http://www.avast.com/free-antivirus-download">anti</a>-<a title="ClamAV" href="http://www.clamav.net/lang/en/about/win32/" target="_blank">virus</a> <a title="Microsoft Security Essentials" href="http://www.microsoft.com/security_essentials/" target="_blank">package</a> (for free!)
<ul>
<li>People get sucked into the Symantec/McAfee scheme and then don&#8217;t want to or won&#8217;t pay for updates.  Get a free product that works just as well, if not better and consuming less computer resources, than the commercial software.</li>
</ul>
</li>
<li>Know how to boot into <a title="Safe Mode" href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/boot_failsafe.mspx?mfr=true" target="_blank">Safe Mode</a> and other special modes
<ul>
<li>A lot of malware can easily be deleted in malware, yet you&#8217;ll <a title="Geek Squad Rates" href="http://www.geeksquad.com/services/computer/category.aspx?id=231" target="_blank">pay Geek Squad</a> a minimum of $50 to do something you can do/prevent yourself.</li>
</ul>
</li>
<li><strong>Read</strong> what your computer is telling you.  Ignorance is <strong>not</strong> bliss for Windows.
<ul>
<li>Did your McAfee subscription expire and so you&#8217;re not receiving virus definition updates?</li>
<li>Are you visit a website that &#8220;may harm your computer?&#8221;</li>
<li>Do you know who wrote the software you&#8217;re installing, read the EULA, and realize it&#8217;s also installing 3 other programs?</li>
</ul>
</li>
<li>Google is your friend
<ul>
<li>98% of the time, you&#8217;re not the first person to have a computer problem.  It&#8217;s probably been answered on at least 5 discussion board very thoroughly and given a few good keywords, Google will lead you right to it.  Microsoft&#8217;s knowledge base is also a pretty good resource.</li>
</ul>
</li>
</ul>
<p>There was a (+5 Insightful) comment on <a href="http://ask.slashdot.org/comments.pl?sid=1587644&amp;cid=31529076" target="_blank">Slashdot</a> earlier that I think is spot on.  It went a little something like:</p>
<blockquote><p>Anti-virus::Washing your hands, Software Patches::Regular doctor visits, Shady porn sites::Cheap hookers, Clicking random links::Sharing needles, Downloading unknown programs::trusting random person with your SSN</p></blockquote>
<p>And for the last time, computer science != {malware removal, free MS Office, $10 websites, &#8230;}, but most of us will be happy to help you if we can.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gregfiumara.com/?feed=rss2&amp;p=54</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac OS X on Dell Inspiron Mini 10v</title>
		<link>http://blog.gregfiumara.com/?p=42</link>
		<comments>http://blog.gregfiumara.com/?p=42#comments</comments>
		<pubDate>Fri, 19 Feb 2010 21:55:05 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[10v]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[dell]]></category>
		<category><![CDATA[hackintosh]]></category>
		<category><![CDATA[inspiron]]></category>
		<category><![CDATA[mini]]></category>
		<category><![CDATA[netbookinstaller]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[sleep]]></category>
		<category><![CDATA[snow leopard]]></category>

		<guid isPermaLink="false">http://blog.gregfiumara.com/?p=42</guid>
		<description><![CDATA[I spent today doing a lot of  favors for people, including getting Mac OS X 10.6 (Snow Leopard) running on a friend&#8217;s Dell Inspiron Mini 10v.  Making a hackintosh out of these machines used to be a pain, but it&#8217;s really quite easy now. This machine was running the A06 firmware, and I didn&#8217;t have [...]]]></description>
			<content:encoded><![CDATA[<p>I spent today doing a lot of  favors for people, including getting Mac OS X 10.6 (Snow Leopard) running on a friend&#8217;s Dell Inspiron Mini 10v.  Making a hackintosh out of these machines used to be a pain, but it&#8217;s really quite easy now.<span id="more-42"></span> This machine was running the A06 firmware, and I didn&#8217;t have too much of a problem.</p>
<ol>
<li>Push a OS X Install DVD to an 8GB USB flash drive, with one MBR partition.</li>
<li>Run <a title="NetBook Installer Homepage" href="http://code.google.com/p/netbook-installer/" target="_blank">NetBook Maker</a> on the flash drive.  I used version 0.8.3a.  This takes care of adding in a lot of the kernel extensions automatically after OS X installation that you used to have to do manually.</li>
<li>Boot the 10v from the flash drive and run the normal OS X install by pressing F12 when you see the Dell logo and choosing USB Mass Storage.  <em>Note that my install hung near the end, but looking at the installer log (Command-L during installation), it looked like NetBook Installer had installed its kernel extensions and forgot to give control back to the OS X Installer.  I forced a reboot and then manually deleted /Mac OS X Installer Data.</em></li>
</ol>
<p>That&#8217;s it!  It really is that simple now.  I did encounter a few things that needed tweaking after the install:</p>
<p><strong>No Sound After 10.6.2 Update</strong></p>
<p>After I installed the 10.6.2 update, sound no longer worked.  Simply run /Applications/NetBook Installer.  Check &#8220;Install General Extensions&#8221; and &#8220;Fix bluetooth&#8221;.  After a reboot, everything should work fine.  This will probably have to be done after every subsequent OS X update because these updates most likely overwrite the kernel extensions or their cache installed/created by NetBook Installer.</p>
<p><strong>Screen Stays Dark after Sleep</strong></p>
<p>After waking the 10v from sleep, the screen would not come back on, though you can hear the hard drive spin up.  The solution is to disable USB Legacy BIOS support in the BIOS (press F2 when you see the Dell logo at boot).  Arrow over to <em>Advanced</em>, then down to <em>USB Legacy BIOS</em>.  Press return and choose <em>Disabled</em>.  Arrow back up and over to <em>Exit</em> and choose <em>Save and Exit</em>.  Sleep problems solved.</p>
<p><strong>Software Updates Won&#8217;t Install</strong></p>
<p>A number of updates, including Java Update 1 and Security Update 2010-001 just would not install from the Software Update program.  Heading over to the <a title="Apple Downloads" href="http://support.apple.com/downloads" target="_blank">Apple Support Download</a> web site and downloading the updaters manually did the trick.</p>
<p><strong>Short Sounds Don&#8217;t Play</strong></p>
<p>OS X likes to turn off the sound driver when not in use, which makes shorter sounds not play after no sound has been output for a few minutes.  Use <a title="AnitPop" href="http://www.tomsick.net/projects/antipop" target="_blank">antipop</a> to keep everything sounding smooth.  It use OS X&#8217;s speech mechanism to speak a space character every 10 seconds, keeping the audio turned on.  There&#8217;s absolutely no hit on performance.  By default, antipop only runs when the netbook is charging, but simply execute the following command and reboot to have anitpop run when on battery mode.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>antipop<span style="color: #000000; font-weight: bold;">/</span>ac_only</pre></div></div>

<p>That&#8217;s about it.  Now I have a &lt; $300 machine that&#8217;s almost as powerful as Apple&#8217;s $1000+ equivalents.  Unfortunately, I have to return it to its owner now <img src='http://blog.gregfiumara.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p><a href="http://blog.gregfiumara.com/wp-content/uploads/2010/02/IMG_0661.jpg"><img class="aligncenter size-medium wp-image-51" title="Snow Leopard on Dell Inspiron Mini 10v" src="http://blog.gregfiumara.com/wp-content/uploads/2010/02/IMG_0661-300x254.jpg" alt="Snow Leopard on Dell Inspiron Mini 10v" width="300" height="254" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gregfiumara.com/?feed=rss2&amp;p=42</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reed Switches (Or How I Fixed My MacBook Pro)</title>
		<link>http://blog.gregfiumara.com/?p=34</link>
		<comments>http://blog.gregfiumara.com/?p=34#comments</comments>
		<pubDate>Wed, 20 Jan 2010 02:35:02 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[macbook pro]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[reed switch]]></category>
		<category><![CDATA[sleep]]></category>

		<guid isPermaLink="false">http://gregfiumara.com/blog/?p=34</guid>
		<description><![CDATA[A few months ago, I dropped my 15&#8243; MacBook Pro from about 3 feet.  Upon immediate inspection, I only noticed a small dent near the DVI connector, but I figured that was the extent of the damage since the computer was off (or at least in sleep mode) at the time. The next time I [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago, I dropped my 15&#8243; MacBook Pro from about 3 feet.  Upon immediate inspection, I only noticed a small dent near the DVI connector, but I figured that was the extent of the damage since the computer was off (or at least in sleep mode) at the time.<span id="more-34"></span></p>
<p>The next time I turned on the laptop, it went to sleep after a few minutes.  I would power it back on and it would go to sleep again seconds later.  This repeated again and again.  I decided to let it sit overnight.  The next morning, I powered it on and it would stay on for about 15 minutes before it would go to sleep, only this time when I would wake it back up the screen would not come back on.  This happened for two weeks before I could get a new laptop (thanks State Farm Insurance, for covering a large chunk of the purchase).  In the mean time, I used the machine with an external display.  For whatever reason, when the DVI port was in use, the machine would stay awake.</p>
<p>I figured the problem had something to do with the &#8220;sleep sensor&#8221; in the MacBook Pro.  When the computer would stay awake, the screen worked fine and the computer itself worked fine.  My thought was that the computer thought the lid was constantly closing and so it would go to sleep.</p>
<p>I thought the &#8220;sleep sensor&#8221; was located in the latch or somewhere in the front of the laptop, but after poking around on the Internet and on the machine, I found out that its located on the back of the right side of the keyboard, right in the middle.  It is something that is commonly called a <a title="Reed Switch on Wikipedia" href="http://en.wikipedia.org/wiki/Reed_switch" target="_blank">reed switch</a>.  It sends an electrical impulse to sleep the computer when the force of a magnet is felt.  The magnet is located in the bezel halfway down the display on the right side.  Confirm this by placing a paperclip in that location!  When you close the lid, the magnet lines up with the sensor on the underside of the right speaker grill and tells OS X to go to sleep.</p>
<div id="attachment_35" class="wp-caption aligncenter" style="width: 310px"><a href="http://gregfiumara.com/blog/wp-content/uploads/2010/01/paperclip.jpg"><img class="size-medium wp-image-35" title="Paperclip on Reed Switch of MacBook Pro" src="http://gregfiumara.com/blog/wp-content/uploads/2010/01/paperclip-300x212.jpg" alt="Paperclip on Reed Switch of MacBook Pro" width="300" height="212" /></a><p class="wp-caption-text">The paperclip shows the location of the magnet portion of the reed switch on the MacBook Pro</p></div>
<p>If you take the top of the laptop off, you&#8217;ll see the second part of the reed switch with a three-wire connector leading to the main keyboard ribbon cable.</p>
<div id="attachment_36" class="wp-caption aligncenter" style="width: 310px"><a href="http://gregfiumara.com/blog/wp-content/uploads/2010/01/reed_switch.jpg"><img class="size-medium wp-image-36" title="The location of the reed switch" src="http://gregfiumara.com/blog/wp-content/uploads/2010/01/reed_switch-300x179.jpg" alt="The location of the reed switch" width="300" height="179" /></a><p class="wp-caption-text">The sensor of the reed switch is located just under the right speaker grill.</p></div>
<div id="attachment_39" class="wp-caption aligncenter" style="width: 310px"><a href="http://gregfiumara.com/blog/wp-content/uploads/2010/01/reed_switch_close.jpg"><img class="size-medium wp-image-39" title="Close up of the reed switch" src="http://gregfiumara.com/blog/wp-content/uploads/2010/01/reed_switch_close-300x225.jpg" alt="Close up of the reed switch" width="300" height="225" /></a><p class="wp-caption-text">Close up of the reed switch</p></div>
<p>I removed, cleaned, and reinstalled the sensor, and now the machine has been working on battery power for hours without a problem (I&#8217;m typing this entry on it now).  I&#8217;ll update this post if something goes awry, but if you&#8217;re having weird sleep problems and think you&#8217;ve tried everything like the dozens of other people that have posted on Apple&#8217;s discussion boards, try cleaning the reed switch and make sure you don&#8217;t have strong magnets near the right side of your MacBook Pro.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gregfiumara.com/?feed=rss2&amp;p=34</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Graduation Day!</title>
		<link>http://blog.gregfiumara.com/?p=32</link>
		<comments>http://blog.gregfiumara.com/?p=32#comments</comments>
		<pubDate>Thu, 24 Dec 2009 05:26:05 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[School]]></category>

		<guid isPermaLink="false">http://gregfiumara.com/blog/?p=32</guid>
		<description><![CDATA[Well, now it&#8217;s Christmas Eve, but yesterday at 10AM I participated in the graduation ceremonies at UMBC.  Not sure how ready I am to leave that place.  On one hand, it will be nice to not have homework or projects for a bit and I can let my stress level lower dramatically.  On the other [...]]]></description>
			<content:encoded><![CDATA[<p>Well, now it&#8217;s Christmas Eve, but yesterday at 10AM I participated in the graduation ceremonies at UMBC.  Not sure how ready I am to leave that place.  On one hand, it will be nice to not have homework or projects for a bit and I can let my stress level lower dramatically.  On the other hand, now I have to drive at least two hours to see anyone I know.  With working full-time in the future, this is going to be a huge pain.  I&#8217;ve been accepted into the Masters program at UMBC and so hopefully that gives me an excuse to be on campus, but I&#8217;m also not sure that&#8217;s what I really want.</p>
<p>There&#8217;s really just too much going through my head right now.  I need to settle down and let it all sink in.  I need the time to do that <strong>now</strong>.</p>
<p>I never thought I would see this day.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gregfiumara.com/?feed=rss2&amp;p=32</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snow, Round 1</title>
		<link>http://blog.gregfiumara.com/?p=25</link>
		<comments>http://blog.gregfiumara.com/?p=25#comments</comments>
		<pubDate>Sun, 20 Dec 2009 01:40:19 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Other]]></category>

		<guid isPermaLink="false">http://gregfiumara.com/blog/?p=25</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<table border="0">
<tbody>
<tr>
<td>
<p><div id="attachment_26" class="wp-caption alignnone" style="width: 310px"><a href="http://gregfiumara.com/blog/wp-content/uploads/2009/12/IMG_0248.jpg"><img class="size-medium wp-image-26" title="Honda in Snow Before" src="http://gregfiumara.com/blog/wp-content/uploads/2009/12/IMG_0248-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Before...</p></div></td>
<td>
<p><div id="attachment_27" class="wp-caption alignnone" style="width: 310px"><a href="http://gregfiumara.com/blog/wp-content/uploads/2009/12/honda_snow.jpg"><img class="size-medium wp-image-27" title="Honda in Snow After" src="http://gregfiumara.com/blog/wp-content/uploads/2009/12/honda_snow-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">...and after.</p></div></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://blog.gregfiumara.com/?feed=rss2&amp;p=25</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UMBC Campus Friend</title>
		<link>http://blog.gregfiumara.com/?p=21</link>
		<comments>http://blog.gregfiumara.com/?p=21#comments</comments>
		<pubDate>Fri, 18 Dec 2009 05:07:36 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[School]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://gregfiumara.com/blog/?p=21</guid>
		<description><![CDATA[I gave my final presentation for my iPhone Development class tonight on my project called UMBC Campus Friend. It&#8217;s an app that tells you places you are near on a campus. From a developer&#8217;s perspective, it&#8217;s very cool in that all you have to do is provide an XML file with POI descriptions and another [...]]]></description>
			<content:encoded><![CDATA[<p>I gave my final presentation for my iPhone Development class tonight on my project called <a href="http://cs491f09.wordpress.com/final-projects/umbc-campus-friend/">UMBC Campus Friend</a>.  It&#8217;s an app that tells you places you are near on a campus.  From a developer&#8217;s perspective, it&#8217;s very cool in that all you have to do is provide an XML file with POI descriptions and another XML file with building coordinates to get the app to work, with zero programming experience necessary.</p>
<p>After the presentation, I was approached by an individual from UMBC&#8217;s DoIT who expressed a great deal of interest and excitement in the app and said that we would probably be in contact.  Several other students thought I should be trying to go somewhere with this app.  They&#8217;re probably right.  I&#8217;m looking to get the ball rolling, beefing up the app to add some features I thought about but didn&#8217;t have time to implement, and hopefully even taking this app to market.  It&#8217;s a good night for sure!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.gregfiumara.com/?feed=rss2&amp;p=21</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
