<?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>Gierad Blogs &#187; Engineering</title>
	<atom:link href="http://www.gierad.com/blog/category/engineering/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gierad.com/blog</link>
	<description>because he dreams for the wisdom of an owl, but has a memory of a goldfish</description>
	<lastBuildDate>Sun, 08 Aug 2010 23:38:22 +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>Sneak Peek of iPhone OS 4.0</title>
		<link>http://www.gierad.com/blog/2010/05/14/sneak-peek-of-iphone-os-4-0/</link>
		<comments>http://www.gierad.com/blog/2010/05/14/sneak-peek-of-iphone-os-4-0/#comments</comments>
		<pubDate>Fri, 14 May 2010 18:36:10 +0000</pubDate>
		<dc:creator>gierad</dc:creator>
				<category><![CDATA[Mobility]]></category>
		<category><![CDATA[Random News]]></category>
		<category><![CDATA[iPhone SDK]]></category>

		<guid isPermaLink="false">http://www.gierad.com/blog/?p=147</guid>
		<description><![CDATA[On April 8, 2010, Apple introduced iPhone OS 4. It is Apple&#8217;s fourth major iteration of its limelight mobile operating system with over 100 new features, including the highly sought multi-tasking capability. The new version includes major user experience improvements,  including updates targeted to Enterprise customers. The new look of iPhone OS 4 includes a [...]]]></description>
			<content:encoded><![CDATA[<p>On April 8, 2010, Apple introduced iPhone OS 4. It is Apple&#8217;s fourth major iteration of its limelight mobile operating system with over 100 new features, including the highly sought multi-tasking capability. The new version includes major user experience improvements,  including updates targeted to Enterprise customers.</p>
<p style="text-align: center;"><img class="size-full wp-image-173 alignnone" title="01 - iPhone View" src="http://www.gierad.com/blog/wp-content/uploads/2010/05/01-iPhone-View1.jpg" alt="" width="232" height="445" /><span style="font-size: xx-small;"><em> </em></span></p>
<p style="text-align: center;"><span style="font-size: xx-small;"><em>The new look of iPhone OS 4 includes a 3D dock, and a  customizable wallpaper.</em></span></p>
<p>Apple illustrates the major updates of iPhone OS 4 into &#8220;tent poles&#8221; which are described in the next section.</p>
<p><strong>1. Multi-tasking</strong></p>
<p>This is perhaps the biggest update to iPhone OS 4. Make no mistake, the iPhone already supports multi-tasking on some of its native applications like Mail and iPod. However, it has closed this door to third-party applications because allowing them to run in the background affects the phone&#8217;s battery life and performance.</p>
<p>The big question to ask is: <em>how does iPhone OS 4 support multi-tasking without affecting performance</em>?</p>
<p>Rather than allowing applications to run freely in the background, Apple&#8217;s approach is to provide <em>a la carte</em> multi-tasking <em>services</em>. This ensures that an application will only use the multi-tasking function it needs without adulterating the performance of the entire device.</p>
<p>The multi-tasking services that are offered for iPhone OS 4 include:</p>
<ul>
<li><strong>Background Audio </strong>- this service will allow applications like <em>Pandora</em>, and <em>Ambience</em> to play audio on the background.<strong> </strong></li>
<li><strong>Voice Over IP </strong>- this service will allow applications like <em>Skype</em>, and <em>Fring</em> to receive VoIP calls even when the application is not running.<strong> </strong></li>
<li><strong>Background Location </strong>- this service will allow applications like <em>Loopt</em> and <em>FourSquare</em> to constantly update user location even when the application is not running. Instead of polling GPS data, this service will use triangulation to retrieve location.<strong> </strong></li>
<li><strong>Local Notifications </strong>- this service will allow productivity applications such as to-do lists and calendars to send notifications to the phone without having to use Apple&#8217;s Push Notification Service (PNS).<strong> </strong></li>
<li><strong>Task Finishing -</strong> this service will allow tasks that take a while to load (like uploading a picture on Facebook) to run in the background even when the application is not active.<strong> </strong></li>
<li><strong>Fast App Switching –</strong> this service will allow an application to save its entire state (i.e. state of a chess game) to enable users to swiftly change between applications without any delay.<strong> </strong></li>
</ul>
<p>With the iPhone OS 4 sporting new multi-tasking capabilities, there is a lot of creative potential for forthcoming applications.</p>
<p style="text-align: center;"><img class="size-full wp-image-169 aligncenter" title="02 - Background Apps" src="http://www.gierad.com/blog/wp-content/uploads/2010/05/02-Background-Apps.jpg" alt="" width="232" height="445" /> <img class="alignnone size-full wp-image-170" title="03 - Kill Background Apps" src="http://www.gierad.com/blog/wp-content/uploads/2010/05/03-Kill-Background-Apps.jpg" alt="" width="232" height="445" /></p>
<p style="text-align: center;"><span style="font-size: xx-small;"><em>With Multi-tasking, users can switch between apps at anytime by  double-clicking the home button. Running apps can be killed by tapping and holding  the app icon.</em></span></p>
<p><strong>2. </strong><strong>Enterprise</strong></p>
<p>Enterprises have long had rancorous feelings about supporting the iPhone. In iPhone OS 3, the iPhone had spotty support for key enterprise features that were critical to enterprise adoption.</p>
<p>The release of iPhone OS 4 provides some important updates that might entice Enterprise decision-makers to take a second look at the iPhone. These new features include:</p>
<ul>
<li>Data Protection</li>
<li>Wireless App Distribution</li>
<li>Improved Mail</li>
<li>Mobile Device Management</li>
<li>SSL VPN Support</li>
</ul>
<p><strong> </strong></p>
<p><strong>Other major features of iPhone OS 4 include:</strong><strong> </strong></p>
<p><strong>3. </strong><strong>Folders </strong></p>
<p><strong> </strong></p>
<p>Scrolling through multiple pages before finding that favorite application? Android users don&#8217;t have a problem with this. However, with iPhone OS 4, applications can be organized and grouped into folders. Dragging the application on top of another application automatically creates a folder, reducing clutter. This also increases the current limit of 180 applications to 2160.</p>
<p style="text-align: center;"><img class="size-full wp-image-177 aligncenter" title="04 - Folders" src="http://www.gierad.com/blog/wp-content/uploads/2010/05/04-Folders.jpg" alt="" width="232" height="445" /> <img class="alignnone size-full wp-image-178" title="05 - Folder Open" src="http://www.gierad.com/blog/wp-content/uploads/2010/05/05-Folder-Open.jpg" alt="" width="232" height="445" /><span style="font-size: xx-small;"><em> </em></span></p>
<p style="text-align: center;"><span style="font-size: xx-small;"><em>With Folders, apps can be organized to reduce clutter and  improve usability.</em></span></p>
<p><strong>4. </strong><strong>Even Better Mail </strong></p>
<p><strong> </strong></p>
<p>With iPhone OS 4, the Mail application now supports a unified inbox. It also includes support for viewing messages as threads, and opening attachments using third party applications.</p>
<p><strong>5. </strong><strong>iBooks</strong></p>
<p>Apple&#8217;s e-reader application that comes pre-installed on the iPad will be available to iPhone users with the update of iPhone OS 4. Similar to Amazon&#8217;s Kindle e-reader, a massive library of books can be purchased and downloaded straight from the iBooks application.<strong> </strong></p>
<p><strong>6. </strong><strong>Game</strong><strong> Center</strong></p>
<p>With Apple&#8217;s successful business model for game development and distribution, is not surprising why Nintendo calls them &#8220;the enemy of the future&#8221;. In a move to aggrandize its market share, Apple is providing a new social platform for its avid gamers by introducing Game Center on iPhone OS 4. With Game Center, users can play multiplayer games, view ranks, and chat with their favorite buddies similar to Xbox Live.</p>
<p style="text-align: center;"><img class="size-full wp-image-179 aligncenter" title="06 - Game Center" src="http://www.gierad.com/blog/wp-content/uploads/2010/05/06-Game-Center.jpg" alt="" width="232" height="445" /></p>
<p style="text-align: center;"><em><span style="font-size: xx-small;">Game Center provides a social platform for avid iPhone / iPod  touch gamers similar to Xbox Live.</span></em></p>
<p><strong>7. </strong><strong>iAd</strong></p>
<p>iAd is Apple&#8217;s new mobile advertising platform to help developers with revenue generation. Current ads found in most free iPhone applications resemble that of classic web banners where users are taken to an external website when clicked.  With iAds, apps can feature highly interactive ads that combine the emotion of TV with the interactivity of the web. Think of these ads as &#8220;micro-apps&#8221;, or an app within an app.</p>
<p><strong> </strong></p>
<p><strong>To wrap it up&#8230;<br />
</strong></p>
<p>iPhone OS 4 is a major update for the OS. The addition of multi-tasking capabilities, coupled with several improvements in the user experience puts the OS ahead of its competition. Apple claims to have the best implementation of multi-tasking among its competitors. Their name will be put to the test come June.</p>
<p>To learn more about the upcoming iPhone OS 4.0, visit the <a href="http://www.apple.com/iphone/preview-iphone-os/">Apple</a> website or watch the <a href="http://www.apple.com/quicktime/qtv/specialevent0410/" target="_blank">Keynote address</a> . If you are an official iPhone Developer, you can download a beta version of iPhone OS 4 from the developer portal.</p>
<hr size="1" />
]]></content:encoded>
			<wfw:commentRss>http://www.gierad.com/blog/2010/05/14/sneak-peek-of-iphone-os-4-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone OS 4.0 is Coming</title>
		<link>http://www.gierad.com/blog/2010/04/05/iphone-os-4-0-is-coming/</link>
		<comments>http://www.gierad.com/blog/2010/04/05/iphone-os-4-0-is-coming/#comments</comments>
		<pubDate>Mon, 05 Apr 2010 19:56:59 +0000</pubDate>
		<dc:creator>gierad</dc:creator>
				<category><![CDATA[Mobility]]></category>
		<category><![CDATA[iPhone SDK]]></category>

		<guid isPermaLink="false">http://www.gierad.com/blog/?p=140</guid>
		<description><![CDATA[Apple has announced a surprise event on April 8th to reveal details on the much anticipated iPhone OS 4.0.  This event should spill the beans on multi-tasking support and other new features. Im curious to see what&#8217;s in store for the future of iPhone OS&#8230;]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gierad.com/blog/wp-content/uploads/2010/04/iphoneOS-e1270497392487.jpg"><img class="alignnone size-full wp-image-141" title="iphoneOS" src="http://www.gierad.com/blog/wp-content/uploads/2010/04/iphoneOS-e1270497392487.jpg" alt="" width="400" height="290" /></a></p>
<p>Apple has announced a surprise event on April 8th to reveal details on the much anticipated iPhone OS 4.0.  This event should spill the beans on multi-tasking support and other new features. Im curious to see what&#8217;s in store for the future of iPhone OS&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gierad.com/blog/2010/04/05/iphone-os-4-0-is-coming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Touch Me Not</title>
		<link>http://www.gierad.com/blog/2010/03/24/touch-me-not/</link>
		<comments>http://www.gierad.com/blog/2010/03/24/touch-me-not/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 17:01:25 +0000</pubDate>
		<dc:creator>gierad</dc:creator>
				<category><![CDATA[Mobility]]></category>

		<guid isPermaLink="false">http://www.gierad.com/blog/?p=123</guid>
		<description><![CDATA[With  the success of the iPhone,  touch-screen phones have flooded display shelves, and the number of people with these devices are growing.  As companies incorporate touch screens in their handsets, they have done so with varying degrees of success. &#160; If you plan to buy one of these gadgets, an important thing to consider is [...]]]></description>
			<content:encoded><![CDATA[<div>
<div>With  the success of the iPhone,  touch-screen phones have flooded display shelves, and the number of people with these devices are growing.  As companies incorporate touch screens in their handsets, they have done so with varying degrees of success.</div>
<div>&nbsp;</div>
<div>If you plan to buy one of these gadgets, an important thing to consider is how well you can use them.  Does Phone A provide you with a great user experience? Does Phone B frustrate you because its almost impossible to type on its virtual keyboard?</div>
<div>&nbsp;</div>
<div>The MOTO research group examined the performance of leading touch-screen smartphones. The goal was to visually measure the effectiveness of touch-screens from various handsets. What they found may actually surprise you.</div>
<div>&nbsp;</div>
<div><a href="http://www.gierad.com/blog/wp-content/uploads/2010/03/touchscreen_comparisons.jpg"><img class="alignnone size-full wp-image-128" title="touchscreen_comparisons" src="http://www.gierad.com/blog/wp-content/uploads/2010/03/touchscreen_comparisons.jpg" alt="" width="420" height="350" /></a></div>
<div>&nbsp;</div>
<div>MOTO initially had a person going through each phone and running tests with fingers pressing at varying pressure points. But their initial experiment was deemed &#8220;scientifically flawed&#8221; because it wasn&#8217;t precise enough. Surprisingly, the group responded by performing a second test, this time creating a mechanized hand (a robot) to simulate user touches (see image).</div>
<div>&nbsp;</div>
<div><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="300" 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://vimeo.com/moogaloop.swf?clip_id=10367683&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="300" src="http://vimeo.com/moogaloop.swf?clip_id=10367683&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></div>
<div>&nbsp;</div>
<div>No matter how much &#8220;power&#8221; or &#8220;features&#8221; a phone claims to have, it is very critical to provide an excellent user experience. For touch screens, this means being able to respond to finger taps and touches with high sensitivity, all the time. This is a great formula for happy users.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.gierad.com/blog/2010/03/24/touch-me-not/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>If I could do anything, I would&#8230;</title>
		<link>http://www.gierad.com/blog/2010/02/17/if-i-could-do-anything-i-would/</link>
		<comments>http://www.gierad.com/blog/2010/02/17/if-i-could-do-anything-i-would/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 14:39:14 +0000</pubDate>
		<dc:creator>gierad</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Creative]]></category>
		<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Philosophy]]></category>
		<category><![CDATA[Random News]]></category>
		<category><![CDATA[Running]]></category>
		<category><![CDATA[Science and Math]]></category>

		<guid isPermaLink="false">http://www.gierad.com/blog/?p=92</guid>
		<description><![CDATA[This quote struck me so much that I&#8217;ve been using it as a source of inspiration. It&#8217;s the theme for Doodle for Google 2009.  Its a motivation for thinking big, reaching for you dreams, and changing the world. &#8220;If I could do anything, I would&#8230;&#8221; Create technology that would change people&#8217;s lives Build a beautiful [...]]]></description>
			<content:encoded><![CDATA[<p>This quote struck me so much that I&#8217;ve been using it as a source of inspiration. It&#8217;s the theme for Doodle for Google 2009.  Its a motivation for thinking big, reaching for you dreams, and changing the world.</p>
<p>&#8220;If I could do anything, I would&#8230;&#8221;</p>
<ul>
<li>Create technology that would change people&#8217;s lives</li>
<li>Build a beautiful house for every family in the world</li>
<li>Eliminate poverty, eliminate diseases, and get rid of pornography</li>
<li>Provide everybody in the world the chance to fulfill their dreams</li>
<li>Create a bridge from Michigan to Cebu, or perhaps a tunnel or a teleport machine&#8230;</li>
<li>Have YFC/SFC household on the moon</li>
<li>Learn the ability to walk on water so I can run around the world..</li>
<li>Travel the solar system within 3 days, starting from the Sun, with a pit-stop at the rings of Saturn, and finally surfing around the outskirts of the milky way. Then I would fly back to Earth, rest for a few days, and Start making plans to travel to a different universe..</li>
<li>Allow snow to fall in the Philippines (for a few days the most) so people there can finally experience their first snow</li>
<li>Swim with a blue whale as he takes me around to the wonders of the ocean</li>
<li>Travel the world with my wife</li>
<li>If I could do anything, I would still read books, go to Grad school, and be able to learn and explore the fascinating world around us..</li>
<li>If I could do anything, I would&#8230; Do more&#8230;</li>
</ul>
<p>If you could do anything, what would you do?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gierad.com/blog/2010/02/17/if-i-could-do-anything-i-would/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Benford&#8217;s Law</title>
		<link>http://www.gierad.com/blog/2009/12/07/benfords-law/</link>
		<comments>http://www.gierad.com/blog/2009/12/07/benfords-law/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 03:57:32 +0000</pubDate>
		<dc:creator>gierad</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Science and Math]]></category>

		<guid isPermaLink="false">http://www.gierad.com/blog/?p=66</guid>
		<description><![CDATA[I was listening to the Numbers episode of Radiolab and came across a very interesting topic: Benford&#8217;s Law. In its simplest form, Benford&#8217;s Law says that there is a distinctive pattern on the &#8220;population&#8221; of numbers. If you gather all the numbers in the world (from numbers found in stock prices, to newspapers, height of [...]]]></description>
			<content:encoded><![CDATA[<p>I was listening to the <a href="http://www.wnyc.org/shows/radiolab/episodes/2009/10/09" target="_blank">Numbers</a> episode of <a href="http://www.radiolab.org" target="_blank">Radiolab</a> and came across a very interesting topic: <a href="http://en.wikipedia.org/wiki/Benford's_law" target="_blank">Benford&#8217;s Law</a>.</p>
<p>In its simplest form, Benford&#8217;s Law says that there is a distinctive pattern on the &#8220;population&#8221; of numbers. If you gather all the numbers in the world (from numbers found in stock prices, to newspapers, height of buildings, temperatures, cash registers, etc.), <strong>approximately 30% of them start with # 1</strong>. Let me repeat that, <span style="color: #99cc00;"><strong><span style="color: #ff0000;">about 30% of numbers in the world start with #1.</span></strong></span></p>
<p>But wait there&#8217;s more!</p>
<p>About 18% of all numbers in the world begin with #2. About 13% begin with #3. See the pattern?</p>
<p>And here&#8217;s the entire gamut:</p>
<ul>
<li><strong>#4</strong>:  9.7%</li>
<li><strong>#5</strong>:  7.9%</li>
<li><strong>#6</strong>:  6.7%</li>
<li><strong>#7</strong>:  5.8%</li>
<li><strong>#8</strong>:  5.1%</li>
<li><strong>#9</strong>:  4.6%</li>
</ul>
<p>Visualizing this pattern, we get:</p>
<p><a href="http://mathworld.wolfram.com/BenfordsLaw.html" target="_blank"><img class="alignnone size-full wp-image-70" title="BenfordsLaw_graph" src="http://www.gierad.com/blog/wp-content/uploads/2009/12/BenfordsLaw_graph.gif" alt="BenfordsLaw_graph" width="364" height="228" /></a></p>
<p>So what&#8217;s so significant about Benford&#8217;s Law? Surprisingly, the natural distribution of numbers is so universal that it can be applied to any numerical context (i.e. finance reports, random numbers). Any deviation from this pattern denotes that the numbers have been manually modified. In fact, Benford&#8217;s Law has been used to detect accounting fraud and other related crimes (see example below).</p>
<p><a href="http://www.journalofaccountancy.com/Issues/1999/May/nigrini.htm" target="_blank"><img class="alignnone size-full wp-image-69" title="benfordsLaw_fraud_example" src="http://www.gierad.com/blog/wp-content/uploads/2009/12/benfordsLaw_fraud_example.gif" alt="benfordsLaw_fraud_example" width="237" height="336" /></a></p>
<p><strong>Lesson</strong>: don&#8217;t mess with numbers (unless you follow Benford&#8217;s Law).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gierad.com/blog/2009/12/07/benfords-law/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Have you seen a GIANT Red Balloon??</title>
		<link>http://www.gierad.com/blog/2009/12/03/have-you-seen-a-giant-red-balloon/</link>
		<comments>http://www.gierad.com/blog/2009/12/03/have-you-seen-a-giant-red-balloon/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 16:23:30 +0000</pubDate>
		<dc:creator>gierad</dc:creator>
				<category><![CDATA[Creative]]></category>
		<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Random News]]></category>

		<guid isPermaLink="false">http://www.gierad.com/blog/?p=54</guid>
		<description><![CDATA[UPDATE: Results are in. MIT Red Balloon Team has won the competition. Great effort! I&#8217;m curious to know how teams approached this problem. If you have seen one, please let me (or our team) know! This Saturday (December 5), DARPA, The Defense Advanced Research Projects Agency, will release 10 red balloons at fixed locations. The [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-57" title="balloon_small" src="http://www.gierad.com/blog/wp-content/uploads/2009/12/balloon_small.jpg" alt="balloon_small" width="216" height="223" /></p>
<p><strong>UPDATE</strong>: Results are in. MIT Red Balloon Team has won the competition. Great effort! I&#8217;m curious to know how teams approached this problem.</p>
<p>If you have seen one, please let me (<a href="http://ispyaredballoon.com/">or our team</a>) know!</p>
<p>This Saturday (December 5), DARPA, The Defense Advanced Research Projects Agency, will release 10 red balloons at fixed locations. <strong>The challenge is to FIND THEM</strong>. The first individual or group to locate all 10 balloons will receive a $40,000 cash prize. This task may be harder than it seems so we need a lot of help!</p>
<p><a href="http://ispyaredballoon.com/">Join our team</a>. <a href="http://www.facebook.com/group.php?gid=201028633372">Click here to join our Facebook group</a>.</p>
<p>Pass it along! Tell your friends, your girlfriends, your girlfriends&#8217; girlfriends, and your girlfriends&#8217; girlfriends&#8217; grandparents!</p>
<p><em><a href="http://networkchallenge.darpa.mil/">More information on the DARPA Network Challenge</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gierad.com/blog/2009/12/03/have-you-seen-a-giant-red-balloon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone SDK: Dealing with .plist Files</title>
		<link>http://www.gierad.com/blog/2009/11/28/iphone-sdk-dealing-with-plist-files/</link>
		<comments>http://www.gierad.com/blog/2009/11/28/iphone-sdk-dealing-with-plist-files/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 15:25:13 +0000</pubDate>
		<dc:creator>gierad</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Engineering]]></category>
		<category><![CDATA[iPhone SDK]]></category>

		<guid isPermaLink="false">http://www.gierad.com/blog/?p=27</guid>
		<description><![CDATA[Loading Contents of .plist file to an Array The most straightforward method for dealing with .plist files is +[NSArray initWithContentsOfFile:path]. However, you need to specify the correct path of the plist file via [NSBundle pathForResource:plist ofType:]. Loading to a Dictionary To load the contents of a .plist file to a dictionary,  instantiate a NSDictionary or [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Loading Contents of .plist file to an Array</strong></p>
<p>The most straightforward method for dealing with .plist files is +[NSArray initWithContentsOfFile:path]. However, you need to specify the correct path of the plist file via [NSBundle pathForResource:plist ofType:].</p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="objc" style="font-family:monospace;"><span class="sy0">-</span> <span class="br0">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/"><span class="kw5">NSArray</span></a> <span class="sy0">*</span><span class="br0">&#41;</span>arrayFromPlist<span class="sy0">:</span> <span class="br0">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span><span class="br0">&#41;</span>plist <span class="br0">&#123;</span>
     <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span>path <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSBundle_Class/"><span class="kw5">NSBundle</span></a> mainBundle<span class="br0">&#93;</span> pathForResource<span class="sy0">:</span>plist ofType<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;plist&quot;</span><span class="br0">&#93;</span>;
     <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/"><span class="kw5">NSArray</span></a> <span class="sy0">*</span>array <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/"><span class="kw5">NSArray</span></a> alloc<span class="br0">&#93;</span> initWithContentsOfFile<span class="sy0">:</span>path<span class="br0">&#93;</span>;
     <span class="kw1">return</span> array;
 <span class="br0">&#125;</span></pre></div></div>
<p><strong>Loading to a Dictionary</strong></p>
<p>To load the contents of a .plist file to a dictionary,  instantiate a NSDictionary or NSMutableDictionary and initialize it with [NSDictionary initWithContentsOfFile:]</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco;"><div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="objc" style="font-family:monospace;"><span class="sy0">-</span> <span class="br0">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/"><span class="kw5">NSDictionary</span></a> <span class="sy0">*</span><span class="br0">&#41;</span>dictionaryFromPlist<span class="sy0">:</span> <span class="br0">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span><span class="br0">&#41;</span>plist <span class="br0">&#123;</span>
 <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span>path <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSBundle_Class/"><span class="kw5">NSBundle</span></a> mainBundle<span class="br0">&#93;</span> pathForResource<span class="sy0">:</span>plist ofType<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;plist&quot;</span><span class="br0">&#93;</span>;
 <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/"><span class="kw5">NSDictionary</span></a> <span class="sy0">*</span>dict <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/"><span class="kw5">NSDictionary</span></a> alloc<span class="br0">&#93;</span> initWithContentsOfFile<span class="sy0">:</span>path<span class="br0">&#93;</span>;
 <span class="kw1">return</span> dict;
<span class="br0">&#125;</span></pre></div></div></p>
<p><strong>Writing to a .plist</strong></p>
<p>The easiest way to write values to a .plist file is to use a NSDictionary and modify its contents using -[NSDictionary setObject: forKey:]. To save the contents to a .plist file, use -[NSDictionary writeToFile: atomically:].</p>
<p>Atomically writing to a file guarantees that the file, if it exists at all, does not become corrupted even when the system should crash while writing.</p>
<p style="font: normal normal normal 10px/normal Monaco; margin: 0px;"><div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.gierad.com/blog/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="objc" style="font-family:monospace;"><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span>path <span class="sy0">=</span> <span class="co3">@</span><span class="st0">&quot;Path to Plist.plist&quot;</span>;
 <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/"><span class="kw5">NSDictionary</span></a> <span class="sy0">*</span>dict <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/"><span class="kw5">NSDictionary</span></a> alloc<span class="br0">&#93;</span> initWithContentsOfFile<span class="sy0">:</span>path<span class="br0">&#93;</span>;
<span class="br0">&#91;</span>dict setObject<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;Gierad&quot;</span> forKey<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;name&quot;</span><span class="br0">&#93;</span>;
<span class="br0">&#91;</span>dict writeToFile<span class="sy0">:</span>path atomically<span class="sy0">:</span><span class="kw2">YES</span><span class="br0">&#93;</span>;</pre></div></div></p>
<p>Lastly, if you want to read/write small configurations for your app, <em>NSUserDefaults</em> is recommended. It contains methods to easily handle key-value pairs including floats and other objects.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco;">
]]></content:encoded>
			<wfw:commentRss>http://www.gierad.com/blog/2009/11/28/iphone-sdk-dealing-with-plist-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Domain Name!</title>
		<link>http://www.gierad.com/blog/2009/11/21/new-domain-name/</link>
		<comments>http://www.gierad.com/blog/2009/11/21/new-domain-name/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 09:40:42 +0000</pubDate>
		<dc:creator>gierad</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Random News]]></category>
		<category><![CDATA[Web Dev]]></category>

		<guid isPermaLink="false">http://www.gierad.com/blog/?p=13</guid>
		<description><![CDATA[I am proud to announce that gierad.com has been successfully registered! I am planning to move all my old stuff from digitalvent.com to gierad.com. I am still planning to keep digitalvent.com, but I hope to slowly transition to using my new domain name. I am also setting up email accounts for gierad.com to use Gmail. [...]]]></description>
			<content:encoded><![CDATA[<p>I am proud to announce that <em>gierad.com</em> has been successfully registered! I am planning to move all my old stuff from digitalvent.com to gierad.com.</p>
<p>I am still planning to keep digitalvent.com, but I hope to slowly transition to using my new domain name.</p>
<p>I am also setting up email accounts for gierad.com to use Gmail. At the moment of writing, Gmail is waiting for the MX records to fully propagate across the Internet (which could take up to 48 hours).</p>
<p>I will post updates when they come.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gierad.com/blog/2009/11/21/new-domain-name/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My BlackBerry Runs on the Simulator, Now What?</title>
		<link>http://www.gierad.com/blog/2009/11/21/my-blackberry-runs-on-the-simulator-now-what/</link>
		<comments>http://www.gierad.com/blog/2009/11/21/my-blackberry-runs-on-the-simulator-now-what/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 09:09:49 +0000</pubDate>
		<dc:creator>gierad</dc:creator>
				<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Mobility]]></category>

		<guid isPermaLink="false">http://www.gierad.com/blog/?p=5</guid>
		<description><![CDATA[BlackBerry Code Signing Update: Companies that are part of the BlackBerry Trial Premier Support can obtain signing keys for free. Contact your BlackBerry Account Manager for more details. You create apps for the BlackBerry and it runs perfect on the simulator. Now you want to deploy it on an actual device. It may sound easy, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>BlackBerry Code Signing </strong></p>
<p><img style="float: left; border: 0px initial initial;" title="BlackBerry" src="http://www.streamingvidonline.com/photos/BlackBerry-Bold-4.jpg" alt="" width="277" height="271" /></p>
<p><em><strong>Update:</strong> Companies that are part of the BlackBerry Trial Premier Support can obtain signing keys for free. Contact your BlackBerry Account Manager for more details.</em></p>
<p>You create apps for the BlackBerry and it runs perfect on the simulator. Now you want to deploy it on an actual device. It may sound easy, but if your app is using specific BlackBerry API&#8217;s, your program will not function if they are not code-signed. You need to sign-up for API keys from RIM.</p>
<p>So you want to run your app on a BlackBerry device? Start reading!</p>
<p>Basically, you need to do three things:</p>
<ol>
<li>First, you need to fill out the BlackBerry signing keys request form. You can fill out the form <a href="https://www.blackberry.com/SignedKeys/">here</a>. There is a $25 fee for requesting signing keys. During registration, you will be asked for a security PIN. REMEMBER THIS PIN!</li>
<li>Once the form is complete, you will get an email from RIM with attachments (.csi) within 48 hours to 10 business days. You will get three keys in three separate emails.</li>
<li>Finally, install the keys on your machine by running the BlackBerry <em>SignatureTool</em>. This program is located under the BlackBerry JDE installation directory. To run <em>SignatureTool</em>, use the command prompt and type the following:
<p><code><em>java -jar &lt;BB JDE Dir&gt;\SignatureTool.jar &lt;.csi file&gt;</em></code></p>
<p><em><span style="font-style: normal;">This will take you to the SignatureTool registration wizard. The wizard will ask you for the registration PIN mentioned in Step 1. It will also ask you for a personal password. Make sure to remember this personal password since you will be asked for it whenever you compile you BlackBerry app.</span></em></li>
</ol>
<p>That&#8217;s it! The steps might be a bit intimidating at first, but its very straightforward. I still honestly think that RIM should streamline the key signing process similar to the iPhone Developer Program.</p>
<p><em>Additionally, you may also want to read </em><span style="color: #c0c0c0;"><a title="click here for source" href="http://blog.crowe.co.nz/archive/2007/07/11/BlackBerry-Code-Signing-101.aspx" target="_blank"><em>this article from Chris Crowe</em></a><em>.</em></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gierad.com/blog/2009/11/21/my-blackberry-runs-on-the-simulator-now-what/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
