<?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>Zero Inverse</title>
	<atom:link href="http://zeroinverse.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://zeroinverse.com</link>
	<description>Mathematical Equivalent to Infinity</description>
	<lastBuildDate>Sun, 27 Jun 2010 05:45:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Human auditory perception and &#8220;missing fundamentals&#8221;</title>
		<link>http://zeroinverse.com/2010/06/human-auditory-perception-and-missing-fundamentals/</link>
		<comments>http://zeroinverse.com/2010/06/human-auditory-perception-and-missing-fundamentals/#comments</comments>
		<pubDate>Sun, 27 Jun 2010 05:45:18 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[random thoughts]]></category>
		<category><![CDATA[concepts]]></category>
		<category><![CDATA[sound]]></category>

		<guid isPermaLink="false">http://zeroinverse.com/?p=136</guid>
		<description><![CDATA[Did you know there&#8217;s interesting technology built around using higher-order harmonics to &#8220;fake&#8221; people into thinking they are hearing low<a href="http://zeroinverse.com/2010/06/human-auditory-perception-and-missing-fundamentals/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>Did you know there&#8217;s interesting technology built around using higher-order harmonics to &#8220;fake&#8221; people into thinking they are hearing low bass sounds?</p>
<p>This is done because some speakers can&#8217;t produce the low frequencies needed for the bass sounds.  So taking advantage of human auditory perception, you can generate a certain pattern of higher frequency harmonics.  Our brains believe we are hearing the low frequency because we &#8220;fill-in&#8221; the missing fundamental frequency.  Pretty awesome!</p>
<p>Read more about it on Wikipedia!</p>
<p>http://en.wikipedia.org/wiki/Missing_fundamental</p>
]]></content:encoded>
			<wfw:commentRss>http://zeroinverse.com/2010/06/human-auditory-perception-and-missing-fundamentals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips on how to setup, configure, initialize, and START/STOP Audio Units for iPhone</title>
		<link>http://zeroinverse.com/2010/06/tips-for-iphone-audiounits/</link>
		<comments>http://zeroinverse.com/2010/06/tips-for-iphone-audiounits/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 00:44:00 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://zeroinverse.com/?p=131</guid>
		<description><![CDATA[As part of Apple&#8217;s poorly documented information on Audio Units and Remote I/O, there are some subtle issues that cause<a href="http://zeroinverse.com/2010/06/tips-for-iphone-audiounits/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>As part of Apple&#8217;s poorly documented information on Audio Units and Remote I/O, there are some subtle issues that cause RENDER CALLBACKS to not work properly.</p>
<p>Make sure not to set any &#8220;callbacks&#8221; until after Remote I/O unit is fully initialized (i.e. after calling <span style="text-decoration: underline;"><strong>AudioUnitInitialize</strong></span>)</p>
<blockquote><p>An audio unit&#8217;s general opeartions are:<br />
Open an audio unit (AudioComponentInstanceNew)<br />
Configure it based on the context &#8211; AudioUnitSetProperty<br />
Initialise the audio unit (AudioUnitInitialize)<br />
- at this point the audio unit is in a state where it can render audio<br />
Render audio (AudioUnitRender)</p>
<p>An important part of a render operation for an audio unit is to manipulate the various controls that the unit provides<br />
to change the render effects; for instance to change the decay time of a reverb, the cut off frequency of a filter, etc.<br />
These are called parameters, and AudioUnitGetParameter and AudioUnitSetParameter are used to interact with these.</p>
<p>If any reconfiguration of the audio unit is required, then:<br />
uninitialise (AudioUnitUninitialise)<br />
Configure it based on the context &#8211; AudioUnitSetProperty<br />
Initialise the audio unit (AudioUnitInitialize)</p>
<p>Once the host is finished with an audio unit, it closes it:<br />
Dispose audio unit (AudioComponentInstanceDispose)</p>
<p>Audio units can be used programmatically (for instance a mixers could be used to render audio for a game, a generator<br />
to play audio files, etc), or they can be hosted in Digital Audio Workstation (DAW) applications such as Logic, Garage Band.<br />
In the DAW case, it is common for an audio unit to provide a custom view to allow the user to interact with what can be<br />
complex DSP opearations that the audio unit performs. The view is retrieved from an audio unit through AudioUnitGetProperty<br />
and then the host instantiates it (see &lt;AudioUnit/AUCocoaUIView.h&gt;)</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://zeroinverse.com/2010/06/tips-for-iphone-audiounits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone Audio Programming Tips</title>
		<link>http://zeroinverse.com/2010/06/iphone-audio-programming-tips/</link>
		<comments>http://zeroinverse.com/2010/06/iphone-audio-programming-tips/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 00:48:07 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[code snippet]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://zeroinverse.com/?p=125</guid>
		<description><![CDATA[After extensive research into Apple&#8217;s poorly documented audio programming Objective-C classes and API, here are some helpful links. Using RemoteIO<a href="http://zeroinverse.com/2010/06/iphone-audio-programming-tips/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p style="font-size: 19.5px; line-height: 28.5px;">After extensive research into Apple&#8217;s poorly documented audio programming Objective-C classes and API, here are some helpful links.</p>
<p><span style="font-size: medium;"><span style="text-decoration: underline;"><a href="http://atastypixel.com/blog/using-remoteio-audio-unit/">Using RemoteIO audio unit</a></span></span></p>
<p><span style="font-size: medium;"><span style="text-decoration: underline;"><a href="http://www.politepix.com/2010/06/18/decibel-metering-from-an-iphone-audio-unit/">Decibel metering from an iPhone audio unit</a></span></span></p>
<p><span style="text-decoration: underline;"><a href="http://www.iwillapps.com/wordpress/?p=196"><span style="font-size: medium;">Analyse Audio with RemoteIO</span></a></span></p>
<p><span style="font-size: medium;">iPhone Core Audio tutorial</span></p>
<ol>
<li><span style="font-size: medium;"><span style="text-decoration: underline;"><a href="http://timbolstad.com/2010/03/16/core-audio-getting-started-pt1/">http://timbolstad.com/2010/03/16/core-audio-getting-started-pt1/</a></span></span></li>
<li><span style="font-size: medium;"><span style="text-decoration: underline;"><a href="http://timbolstad.com/2010/03/16/core-audio-getting-started-pt2/">http://timbolstad.com/2010/03/16/core-audio-getting-started-pt2/</a></span></span></li>
<li><span style="font-size: medium;"><span style="text-decoration: underline;"><a href="http://timbolstad.com/2010/03/16/core-audio-getting-started-pt3/">http://timbolstad.com/2010/03/16/core-audio-getting-started-pt3/</a></span></span></li>
</ol>
<div>
<h2><span style="text-decoration: underline;"><a rel="bookmark" href="http://www.subfurther.com/blog/?p=507">An iPhone Core Audio brain dump</a></span></h2>
</div>
<blockquote style="font-size: 19.5px; line-height: 28.5px;"><p>It’s hard.  Jens Alfke <a style="font-size: 19.5px; line-height: 28.5px;" href="http://lists.apple.com/archives/coreaudio-api/2009/Feb//msg00103.html">put it thusly</a>:<br style="font-size: 19.5px; line-height: 28.5px;" /></p>
<blockquote style="font-size: 19.5px; line-height: 28.5px;">
<p style="font-size: 19.5px; line-height: 28.5px;">“Easy” and “CoreAudio” can’t be used in the same sentence. <img style="font-size: 19.5px; line-height: 28.5px;" src="http://www.subfurther.com/blog/wp-includes/images/smilies/icon_razz.gif" alt=":P" width="22.5" height="22.5" /> CoreAudio is very powerful, very complex, and under-documented. Be prepared for a steep learning curve, APIs with millions of tiny little pieces, and puzzling things out from sample code rather than reading high-level documentation.</p>
</blockquote>
</blockquote>
<blockquote style="font-size: 19.5px; line-height: 28.5px;">
<ul style="font-size: 19.5px; line-height: 28.5px;">
<li style="font-size: 19.5px; line-height: 28.5px;">
<p style="font-size: 19.5px; line-height: 28.5px;">Media is hard because you’re dealing with issues of hardware I/O, real-time, threading, performance, and a pretty dense body of theory, all at the same time. Webapps are trite by comparison.</p>
</li>
<li style="font-size: 19.5px; line-height: 28.5px;">
<p style="font-size: 19.5px; line-height: 28.5px;">On the iPhone, Core Audio has three levels of opt-in for playback and recording, given your needs, listed here in increasing order of complexity/difficulty:</p>
<ol style="font-size: 19.5px; line-height: 28.5px;">
<li style="font-size: 19.5px; line-height: 28.5px;"><strong style="font-size: 19.5px; line-height: 28.5px;">AVAudioPlayer</strong> – File-based playback of DRM-free audio in Apple-supported codecs.  Cocoa classes, called with Obj-C.  iPhone 3.0 adds <code style="font-size: 19.5px; line-height: 28.5px;">AVAudioRecorder</code> (wasn’t sure if this was NDA, but it’s on the <a style="font-size: 19.5px; line-height: 28.5px;" href="http://developer.apple.com/wwdc/iphone/">WWDC</a> marketing page).</li>
<li style="font-size: 19.5px; line-height: 28.5px;"><strong style="font-size: 19.5px; line-height: 28.5px;">Audio Queues</strong> – C-based API for buffered recording and playback of audio. Since you supply the samples, would work for a net radio player, and for your own formats and/or DRM/encryption schemes (decrypt in memory before handing off to the queue). Inherent latency due to the use of buffers.</li>
<li style="font-size: 19.5px; line-height: 28.5px;"><strong style="font-size: 19.5px; line-height: 28.5px;">Audio Units</strong> – Low-level C-based API.  Very low latency, as little as <a style="font-size: 19.5px; line-height: 28.5px;" href="http://www.subfurther.com/blog/?p=422">29 milliseconds</a>.  Mixing, effects, near-direct access to input and output hardware.</li>
</ol>
</li>
<li style="font-size: 19.5px; line-height: 28.5px;">
<p style="font-size: 19.5px; line-height: 28.5px;">Other important Core API’s not directly tied to playback and recording: <em style="font-size: 19.5px; line-height: 28.5px;">Audio Session Services</em> (for communicating your app’s audio needs to the system and defining interaction with things like background iPod player, ring/silent switch) as well as getting audio H/W metadata, <em style="font-size: 19.5px; line-height: 28.5px;">Audio File Services</em> for reading/writing files, <em style="font-size: 19.5px; line-height: 28.5px;">Audio File Stream Services</em> for dealing with audio data in a network stream, <em style="font-size: 19.5px; line-height: 28.5px;">Audio Conversion Services</em> for converting between PCM and compressed formats (and vice versa), <em style="font-size: 19.5px; line-height: 28.5px;">Extended Audio File Services</em> for combining file and conversion Services (e.g., given PCM, write out to a compressed AAC file).</p>
</li>
</ul>
</blockquote>
<blockquote style="font-size: 19.5px; line-height: 28.5px;">
<ul style="font-size: 19.5px; line-height: 28.5px;">
<li style="font-size: 19.5px; line-height: 28.5px;">Setting a property on an audio unit requires declaring the “scope” that the property applies to. Input scope is audio coming into the AU, output is going out of the unit, and global is for properties that affect the whole unit. So, if you set the stream format property on an AU’s input scope, you’re describing what you will supply <strong style="font-size: 19.5px; line-height: 28.5px;">to</strong> the AU.</li>
</ul>
</blockquote>
<blockquote style="font-size: 19.5px; line-height: 28.5px;">
<ul style="font-size: 19.5px; line-height: 28.5px;">
<li style="font-size: 19.5px; line-height: 28.5px;">
<p style="font-size: 19.5px; line-height: 28.5px;">Make the RemoteIO unit your friend. This is the AU that talks to both input and output hardware. Its use of buses is atypical and potentially confusing. Enjoy the ASCII art:</p>
<pre style="font-size: 18px; line-height: 27px;"><code style="font-size: 18px; line-height: 27px;"><br style="font-size: 18px; line-height: 27px;" />                         -------------------------<br style="font-size: 18px; line-height: 27px;" />                         | i                   o |<br style="font-size: 18px; line-height: 27px;" />-- BUS 1 -- from mic --&gt; | n    REMOTE I/O     u | -- BUS 1 -- to app --&gt;<br style="font-size: 18px; line-height: 27px;" />                         | p      AUDIO        t |<br style="font-size: 18px; line-height: 27px;" />-- BUS 0 -- from app --&gt; | u       UNIT        p | -- BUS 0 -- to speaker --&gt;<br style="font-size: 18px; line-height: 27px;" />                         | t                   u |<br style="font-size: 18px; line-height: 27px;" />                         |                     t |<br style="font-size: 18px; line-height: 27px;" />                         -------------------------<br style="font-size: 18px; line-height: 27px;" /></code></pre>
<p style="font-size: 19.5px; line-height: 28.5px;">Ergo, the stream properties for this unit are</p>
<table style="font-size: 24px; line-height: 28.5px;" border="1">
<thead style="font-size: 24px; line-height: 28.5px;">
<tr style="font-size: 24px; line-height: 28.5px;">
<td style="font-size: 16.5px; line-height: 21px;"><br style="font-size: 16.5px; line-height: 21px;" /></td>
<td style="font-size: 16.5px; line-height: 21px;"><strong style="font-size: 16.5px; line-height: 21px;">Bus 0</strong></td>
<td style="font-size: 16.5px; line-height: 21px;"><strong style="font-size: 16.5px; line-height: 21px;">Bus 1</strong></td>
</tr>
</thead>
<tbody style="font-size: 24px; line-height: 28.5px;">
<tr style="font-size: 24px; line-height: 28.5px;">
<td style="font-size: 16.5px; line-height: 21px;"><strong style="font-size: 16.5px; line-height: 21px;">Input Scope:</strong></td>
<td style="font-size: 16.5px; line-height: 21px;">Set ASBD to indicate what you’re providing for play-out</td>
<td style="font-size: 16.5px; line-height: 21px;">Get ASBD to inspect audio format being received from H/W</td>
</tr>
<tr style="font-size: 24px; line-height: 28.5px;">
<td style="font-size: 16.5px; line-height: 21px;"><strong style="font-size: 16.5px; line-height: 21px;">Output Scope:</strong></td>
<td style="font-size: 16.5px; line-height: 21px;">Get ASBD to inspect audio format being sent to H/W</td>
<td style="font-size: 16.5px; line-height: 21px;">Set ASBD to indicate what format you want your units to receive</td>
</tr>
</tbody>
</table>
</li>
<li style="font-size: 19.5px; line-height: 28.5px;">
<p style="font-size: 19.5px; line-height: 28.5px;">That said, setting up the callbacks for providing samples to or getting them from a unit take global scope, as their purpose is implicit from the property names: <code style="font-size: 19.5px; line-height: 28.5px;">kAudioOutputUnitProperty_SetInputCallback</code> and <code style="font-size: 19.5px; line-height: 28.5px;">kAudioUnitProperty_SetRenderCallback</code>.</p>
</li>
</ul>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://zeroinverse.com/2010/06/iphone-audio-programming-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone &amp; iPod OS usage statistics (as of Dec 2009) &amp; Android OS (as of June 2010)</title>
		<link>http://zeroinverse.com/2010/06/iphone-ipod-osusage-statistics/</link>
		<comments>http://zeroinverse.com/2010/06/iphone-ipod-osusage-statistics/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 23:40:39 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[gadgets]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[statistics]]></category>

		<guid isPermaLink="false">http://zeroinverse.com/?p=123</guid>
		<description><![CDATA[Referenced from http://metrics.admob.com/2009/12/updated-iphone-os-stats/ Updated iPhone OS Stats December 22nd, 2009 We received a couple requests recently for the distribution of<a href="http://zeroinverse.com/2010/06/iphone-ipod-osusage-statistics/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<h4>Referenced from http://metrics.admob.com/2009/12/updated-iphone-os-stats/</h4>
<h2>Updated iPhone OS Stats</h2>
<div>December 22nd, 2009</div>
<p>We received a couple requests recently for the distribution of the iPhone Operating System versions we see throughout our network.  The data below represents the percentage of worldwide traffic we saw from the iPhone and iPod touch from December 14-21st.</p>
<p>It shows that iPod touch users lag iPhone users in upgrading their OS; 97% of our iPhone traffic comes from 3.0 or higher, compared to only 68% of iPod touch traffic.</p>
<p><img src="http://metrics.admob.com/wp-content/uploads/2009/12/iphone.png" alt="iphone" width="344" height="291" /></p>
<p><img src="http://metrics.admob.com/wp-content/uploads/2009/12/ipod.png" alt="ipod" width="340" height="288" /></p>
<p>For developers working on Android applications, platform version might become even more important than it is for iPhone given the wide variety of handsets and capabilities already available.  Fortunately, the Android team has announced a device dashboard based on devices that visit the Android Market.  Visit the <a href="http://android-developers.blogspot.com/2009/12/knowing-is-half-battle.html">Android developer blog for details</a> or the <a href="http://developer.android.com/resources/dashboard/platform-versions.html">actual dashbaord for the most recent data</a>.</p>
<hr />
<h1>Platform Versions</h1>
<div><!-- div.dashboard-panel {   max-width:1000px;   margin:0 0 2em 0;   padding:20px 20px 0 20px;   border:1px solid #d3ecf5;   border-radius:7px;   -moz-border-radius:7px;   -webkit-border-radius:7px;   background-color: #DAF3FC;   box-shadow:2px 3px 1px #eee;   -moz-box-shadow:2px 3px 1px #eee;   -webkit-box-shadow:2px 3px 1px #eee;   overflow:hidden; } #jd-content div.dashboard-panel img {   margin:0 20px 20px 0;   padding:0;   border:1px solid #ccc;   float:left; } #jd-content div.dashboard-panel table {   margin:0 0 20px 0;   float:left;   background-color:#fff; } div.dashboard-panel p {   clear:left; } div.dashboard-panel th {   white-space:nowrap; } -->This page provides data about the relative number of active devices running a given version of the Android platform. This can help you understand the landscape of device distribution and decide how to prioritize the development of your application features for the devices currently in the hands of users. For information about how to target your application to devices based on platform version, see <a href="http://developer.android.com/guide/appendix/api-levels.html">API Levels</a>.</p>
<p><strong>Note:</strong> This data is based on the number of Android devices that have accessed Android Market within a 14-day period ending on the data collection date noted below.</p>
<div><img src="http://chart.apis.google.com/chart?&amp;cht=p&amp;chs=460x250&amp;chd=t:0.1,24.6,25.0,0.1,0.3,50.0&amp;chl=Android%201.1%7CAndroid%201.5%7CAndroid%201.6%7CAndroid%202.0%7CAndroid%202.0.1%7CAndroid%202.1&amp;chco=c4df9b,6fad0c" alt="" width="460" height="250" /></p>
<table>
<tbody>
<tr>
<th>Android Platform</th>
<th>Percent of Devices</th>
</tr>
<tr>
<td>Android 1.1</td>
<td>0.1%</td>
</tr>
<tr>
<td>Android 1.5</td>
<td>24.6%</td>
</tr>
<tr>
<td>Android 1.6</td>
<td>25.0%</td>
</tr>
<tr>
<td>Android 2.0</td>
<td>0.1%</td>
</tr>
<tr>
<td>Android 2.0.1</td>
<td>0.3%</td>
</tr>
<tr>
<td>Android 2.1</td>
<td>50.0%</td>
</tr>
</tbody>
</table>
<p><em>Data collected during two weeks ending on June 16, 2010</em></p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://zeroinverse.com/2010/06/iphone-ipod-osusage-statistics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenGL push/pop transformation matrix</title>
		<link>http://zeroinverse.com/2010/06/opengl-pushpop-transformation-matrix/</link>
		<comments>http://zeroinverse.com/2010/06/opengl-pushpop-transformation-matrix/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 16:03:56 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[code snippet]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[opengl]]></category>

		<guid isPermaLink="false">http://zeroinverse.com/?p=117</guid>
		<description><![CDATA[For those familiar with 3D object manipulation, OpenGL uses a &#8220;transformation matrix stack&#8221; to allow you to apply changes only<a href="http://zeroinverse.com/2010/06/opengl-pushpop-transformation-matrix/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>For those familiar with 3D object manipulation, OpenGL uses a &#8220;transformation matrix stack&#8221; to allow you to apply changes only to certain parts of your OpenGL object rendering without impacting the rest of the rendering.  It operates similar to a software stack.  But it only works for <strong><span style="text-decoration: underline;">translations, rotation, and scaling</span></strong>.  Too bad that the iPhone OpenGL ES does not support push/pop of OpenGL attributes (to control linewidths, etc.)</p>
<blockquote>
<pre><code>glPushMatrix();

// execute here your glTranslate(), glRotate(), glScale()
// if you are going to change the color, then restore it manually to 1,1,1,1

glPopMatrix();</code></pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://zeroinverse.com/2010/06/opengl-pushpop-transformation-matrix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenGL ES quirks on iPhone</title>
		<link>http://zeroinverse.com/2010/06/opengl-es-quirks-on-iphone/</link>
		<comments>http://zeroinverse.com/2010/06/opengl-es-quirks-on-iphone/#comments</comments>
		<pubDate>Sat, 12 Jun 2010 15:58:27 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[code snippet]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[opengl]]></category>

		<guid isPermaLink="false">http://zeroinverse.com/?p=114</guid>
		<description><![CDATA[It&#8217;s great that iPhone supports OpenGL, but there are a few things that are wanting (at least for things we<a href="http://zeroinverse.com/2010/06/opengl-es-quirks-on-iphone/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s great that iPhone supports OpenGL, but there are a few things that are wanting (at least for things we wanted to do).</p>
<p>In this case, it was drawing vector art on the iPhone.  We wanted to draw lines of varying widths, but iPhone does not support glPushAttrib and glPopAttrib.</p>
<p>Normally, if you want to change the state of a lot of different enviroment varibles, such as GL_LIGHTING, glpolygonmode, gllinewidth, things like that, you would use following code:</p>
<blockquote><p>glPushAttrib(GL_ENABLE_BIT);<br />
glPushAttrib(GL_LINE_BIT);<br />
glPushAttrib(GL_POLYGON_BIT);<br />
&#8230;<br />
glPopAttrib();<br />
glPopAttrib();<br />
glPopAttrib();</p></blockquote>
<p>Below is from http://www.bradleymacomber.com/coderef/OpenGLES/ on some of differences on iPhone OpenGL</p>
<blockquote>
<h1><abbr title="Open Graphics Library for Embedded Systems">OpenGL ES</abbr> Limitations (on iPhone)</h1>
<p>The subset of OpenGL for mobile devices is missing a lot of the typical functions. The exact details may come as a surprise. The <a href="http://www.khronos.org/">Khronos</a> site lacks any documentation explaining this. (Presumably this is an excuse for them to sell me a book.) So I am writing down the limitations as I find &#8216;em. Most often the convention seems to be to eliminate functionality that is a convenient re-presentation of more fundamental low-level functionality.</p>
<dl>
<dt><strong>No GLU library.</strong></dt>
<dd>Some handy functions such as <code>gluPerspective()</code> and <code>gluLookAt()</code> will have to be replaced with manual calculations.</dd>
<dd> </dd>
<dt><strong>No immediate-mode rendering.</strong></dt>
<dd>This means there are no <code>glBegin()</code> and <code>glEnd()</code> functions. Instead you must use vertex arrays or vertex buffers. This is no surprise since games shouldn&#8217;t be using immediate mode anyway.</dd>
<dd> </dd>
<dt><strong>Simplified vertex arrays.</strong></dt>
<dd>The <code>glInterleavedArrays()</code> function is unavailable; each array must be specified separately, although <var>stride</var> can still be used. There are no <code>glDrawRangeElements()</code> nor <code>glMultiDrawElements()</code> nor <code>glMultiDrawArrays()</code> functions. Instead use <code>DrawArrays()</code> or <code>DrawElements()</code>. There is also no <code>ArrayElement()</code> function, which makes sense since it requires <code>glBegin()</code> and <code>glEnd()</code>.</dd>
<dd> </dd>
<dt><strong>No quads.</strong></dt>
<dd>All the usual geometric primitives are supported except for <code>GL_QUADS</code>, <code>GL_QUAD_STRIP</code>, and <code>GL_POLYGON</code>. Of course, these are provided for convenience and are almost always easily replaced by triangles.</dd>
<dd> </dd>
<dt><strong>Smaller datatypes.</strong></dt>
<dd>Many functions accept only smaller datatypes such as <code>GL_SHORT</code> instead of <code>GL_INT</code>, or <code>GL_FLOAT</code> instead of <code>GL_DOUBLE</code>. Presumably this is to save space on a device with limited memory and a screen small enough that a lack of fine detail can go unnoticed.</dd>
<dd> </dd>
<dt><strong>GLfixed.</strong></dt>
<dd>This new low-level datatype is introduced to replace a variety of datatypes normally presented. For example, there is no <code>glColor4ub()</code> function. Presumably this helps support devices which do not have a FPU.</dd>
<dd> </dd>
<dt><strong>No glPushAttrib nor glPopAttrib (nor glPushClientAttrib).</strong></dt>
<dd>Well, this is annoying. I guess an iPhone application is supposed to be simple enough that we can keep track of all states manually, eh?</dd>
<dd> </dd>
<dt><strong>No GL_LINE_SMOOTH.</strong></dt>
<dd>Enabling it has no effect.</dd>
<dd> </dd>
<dt><strong>No display lists.</strong></dt>
<dd>Instead use vertex arrays or vertex buffers.</dd>
<dd> </dd>
<dt><strong>No bitmap functions.</strong></dt>
<dd>Functions such as <code>glBitmap()</code> and <code>glRasterPos*()</code> do not exist. This means you cannot render simple bitmap fonts. Instead, textured quads must be rendered. Of course, you could always render vector fonts. Don&#8217;t let me stop you.</dd>
<dd> </dd>
<dt><strong>Texture borders not supported.</strong></dt>
<dd>Probably not a big deal.</dd>
<dd> </dd>
</dl>
</blockquote>
<p>Guess that means I have to manually track some of these changes and revert them back when needed.  This is not always easy to do when other parts of your program can access OpenGL without your knowledge.</p>
]]></content:encoded>
			<wfw:commentRss>http://zeroinverse.com/2010/06/opengl-es-quirks-on-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recompile PHP, IMAP-SSL, and Apache for MAMP 1.9</title>
		<link>http://zeroinverse.com/2010/05/rcompile-mamp-1-9/</link>
		<comments>http://zeroinverse.com/2010/05/rcompile-mamp-1-9/#comments</comments>
		<pubDate>Sat, 29 May 2010 13:04:34 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[IMAP]]></category>
		<category><![CDATA[mamp]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[snow leopard]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://zeroinverse.com/?p=112</guid>
		<description><![CDATA[Finally figured how to compile things on my Mac to support IMAP-SSL.  MAMP does not have this compiled in by<a href="http://zeroinverse.com/2010/05/rcompile-mamp-1-9/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>Finally figured how to compile things on my Mac to support IMAP-SSL.  MAMP does not have this compiled in by default.  Since I want to do local development without having to upload to a Linux server to test every single time, getting MAMP to support IMAP-SSL was critical.<br />
IMAP-SSL is used for things like Gmail access.</p>
<p>It was not easy to compile PHP5.3.2 on MAMP. First of all, you need to download httpd2.0.63 and PHP5.3.2. (I’m using MAMP 1.9 and Mac OSX 10.6.2)</p>
<h3>STEP 1: Backup original MAMP</h3>
<p>Backup your MAMP Applicaiton first in case things go wrong.<br />
It is in /Application/MAMP</p>
<h3>STEP 2: Download source files</h3>
<p>Download software packages and save in a &#8220;source download&#8221; folder somewhere (I used <strong>~/src/</strong>)</p>
<ul>
<li>HTTPD-2.0.63</li>
<li>PHP-5.3.2  (http://php.net/downloads.php)</li>
</ul>
<h3>STEP 3: Build apache httpd</h3>
<p>This step is needed to provide MAMP some build &amp; include files from Apache httpd.<br />
(http://zuzara.com/blog/2010/04/08/compiling-php5-3-2-on-mamp/)</p>
<blockquote>
<pre>% tar jxvf httpd-2.0.63.tar.bz2
% cd httpd-2.0.63
</pre>
</blockquote>
<p>Now you need to edit srclib/apr/include/apr.h like “#define APR_HAS_SENDFILE 0″ after run configure because get an error.</p>
<blockquote>
<pre>./configure \
--prefix=/tmp/httpd-2.0.63 \
--with-php \
--with-mysql \
--enable-rewrite \
--enable-speling \
--enable-ssl \
--enable-deflate \
--enable-mods-shared=all \
--with-included-apr \
--enable-so \
--enable-proxy \
--enable-proxy_connect \
--enable-proxy_ftp \
--enable-echo \
--enable-file_cache \
--enable-mem_cache \
--enable-bucketeer \
--enable-cache \
--enable-case_filter \
--enable-case_filter_in \
--enable-cgid \
--enable-charset_lite \
--enable-disk_cache \
--enable-example
</pre>
</blockquote>
<p>The configuration settings enable the default modules that MAMP builds into their application. This will let you use the MAMP interface to turn on/off the various modules as needed (because MAMP UI controls HTTPD.CONF file).</p>
<blockquote>
<pre>% make
% make install
% cd /tmp/httpd-2.0.63
% cp -r build /Application/MAMP/Library/
% cp -r include /Application/MAMP/Library/
% cp -r modules/mod_* /Applications/MAMP/Library/modules/
</pre>
</blockquote>
<h3>STEP 4: Build PHP-5.3.2</h3>
<h4>Step 4a</h4>
<blockquote>
<pre>% tar jxvf php-5.3.2
% cd php-5.3.2
</pre>
</blockquote>
<p>The below configuration file uses a combination of MAMP-specific folders (/Applications/MAMP/) and Apple-provided files (/usr/).<br />
For those that decide to use DarwinPorts to get some components, these will be located in (/opt/local/).  This is a way to avoid having to go to different websites to download specific modules.</p>
<p>My previous MAMP version was 1.8.? and had a PHP configuration for T1LIB (<strong>&#8211;with-t1lib=/Applications/MAMP/Library</strong>).  I removed T1LIB b/c not installed on MACOSX.</p>
<blockquote>
<pre>./configure \
--prefix=/Applications/MAMP/bin/php5.3 \
--exec-prefix=/Applications/MAMP/bin/php5.3 \
--sysconfdir=/Applications/MAMP/conf/php5.3 \
--with-config-file-path=/Applications/MAMP/conf/php5.3 \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--with-apxs2=/Applications/MAMP/Library/bin/apxs \
--enable-cli \
--with-libxml-dir=/Applications/MAMP/Library \
--with-openssl=/usr \
--with-kerberos=/usr \
--with-zlib=/usr \
--enable-bcmath \
--with-bz2=/usr \
--enable-calendar \
--with-curl=/Applications/MAMP/Library \
--enable-exif \
--enable-ftp \
--with-gd \
--with-jpeg-dir=/usr/local/libjpeg \
--with-png-dir=/usr/local/libpng \
--enable-gd-native-ttf \
--with-ldap=/usr \
--with-ldap-sasl=/usr \
--enable-mbstring=all \
--enable-mbregex \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mysql-sock=/tmp/mysql.sock \
--with-iodbc=/usr \
--enable-shmop \
--with-snmp=/usr \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--with-xmlrpc \
--with-iconv-dir=/usr \
--with-xsl=/usr \
--with-pcre-regex \
--with-imap \
--with-imap-ssl \
--with-mcrypt \
--with-mhash \
--with-freetype-dir=/usr/X11 \
--enable-zend-multibyte \
--with-gettext \
--disable-debug
</pre>
</blockquote>
<h4>Step 4b</h4>
<p><strong>NOTE: You may need to install some packages before compile PHP for some components that are not included.<br />
You can use DarwinPorts, or download individually.</strong></p>
<p><strong>Manual method ==&gt; </strong>http://www.teamonetickets.com/software/howto-setup-php-apache-mysql-dev-environment-on-snow-leopard.html<br />
<strong>MacPorts method ==&gt; </strong>http://zuzara.com/blog/2010/04/08/compiling-php5-3-2-on-mamp/</p>
<p>Instructions for JPEG &amp; PNG missing files (http://www.bill.eccles.net/bills_words/2010/01/building-a-mac-os-x-server-106.html)</p>
<pre>libjpeg, libpng, libmcrypt, IMAP c-client, libintl, gettext, libxml
</pre>
<h4>Step 4c</h4>
<p>Now, we need to work around a <a href="http://bugs.php.net/bug.php?id=49267">bug with inconv linking</a>. Luckily, Apple provides <a href="http://opensource.apple.com/source/apache_mod_php/apache_mod_php-53/patches/iconv.patch">a patch</a>. Either copy the text of that patch and save it as a file or <a href="http://www.teamonetickets.com/software/iconv.patch">download it here</a>.</p>
<blockquote><p><code>curl -O http://www.teamonetickets.com/software/iconv.patch<br />
patch -p1 &lt; iconv.patch</code></p></blockquote>
<h4>Step 4d</h4>
<p>Now that iconv will link properly, continue with our make.</p>
<blockquote>
<pre>% make -j3
% make install</pre>
</blockquote>
<h4>Step 4e</h4>
<p>After you have finished making PHP, it should have copied LIBPHP5.SO to your &#8220;apache&#8221; location.<br />
libphp5.so is located where you set –prefix for apache.<br />
It’s needed to copy to /Applications/MAMP/Library/modules.</p>
<h2><strong>SIDE NOTE: May need to build IMAP-SSL individually.<br />
</strong></h2>
<p>I am not sure if this step was needed, but I also compiled a separate IMAP.SO module (which may already be build during the PHP build).<br />
Compile IMAP first    (http://www.activecollab.com/forums/topic/5844/)</p>
<blockquote>
<pre>cd imap-2007e/
make osx EXTRACFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp"
sudo cp c-client/*.h /opt/local/include/
sudo cp c-client/*.c /opt/local/lib/
sudo cp c-client/c-client.a /opt/local/lib/libc-client.a</pre>
</blockquote>
<p>Reroute to MAMP directory</p>
<blockquote>
<pre>sudo cp c-client/*.h /opt/local/include/
sudo cp c-client/*.c /opt/local/lib/
sudo cp c-client/c-client.a /opt/local/lib/libc-client.a</pre>
</blockquote>
<p>An alternate method is to go into PHP source file into <strong>ext/imap/</strong> and then you can compile just the module.<br />
Use below to CONFIGURE custom IMAP.SO compile</p>
<blockquote>
<pre>./configure --with-php-config=/Applications/MAMP/bin/php5.3/bin/php-config --with-imap=/usr/local --with-kerberos --with-imap-ssl=/usr</pre>
</blockquote>
<h2>Reference Links</h2>
<p>Original IMAP-SSL problem on MAMP</p>
<p>http://www.vargatron.com/2009/03/imap-ssl-with-mamp/</p>
<p>http://www.activecollab.com/forums/topic/5844/</p>
<p>http://www.teamonetickets.com/software/howto-setup-php-apache-mysql-dev-environment-on-snow-leopard.html</p>
<p>http://adylitica.com/2009/11/24/installing-amp-apache-mysql-php-on-mac-os-x-10-6-snow-leopard/</p>
<p>http://php5-imap.darwinports.com/</p>
<p>http://joshhuckabee.com/compiling-php5-imap-support-os-x-leopard</p>
<p>http://www.davidgolding.net/cakephp/upgrading-php-in-mamp.html</p>
<p>http://zuzara.com/blog/2010/04/08/compiling-php5-3-2-on-mamp/</p>
<p>http://diymacserver.com/installing-php/compiling-php-in-64-bits-mode-on-leopard/</p>
]]></content:encoded>
			<wfw:commentRss>http://zeroinverse.com/2010/05/rcompile-mamp-1-9/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using IMAP with MAMP</title>
		<link>http://zeroinverse.com/2010/05/using-imap-with-mamp/</link>
		<comments>http://zeroinverse.com/2010/05/using-imap-with-mamp/#comments</comments>
		<pubDate>Tue, 25 May 2010 17:28:15 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mamp]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://zeroinverse.com/?p=108</guid>
		<description><![CDATA[Apparently MAMP is not compiled with IMAP SSL security support.  This can be quickly checked via PHPINFO(). The problem is<a href="http://zeroinverse.com/2010/05/using-imap-with-mamp/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>Apparently MAMP is not compiled with IMAP SSL security support.  This can be quickly checked via PHPINFO().<br />
The problem is you need to compile your own version of PHP to enable the support.</p>
<p>You can find more information here ==&gt; http://www.vargatron.com/2009/03/imap-ssl-with-mamp/</p>
<p>So instead, I just went ahead and put the PHP files on my server to test IMAP functionality instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://zeroinverse.com/2010/05/using-imap-with-mamp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Password Security</title>
		<link>http://zeroinverse.com/2010/05/password-security/</link>
		<comments>http://zeroinverse.com/2010/05/password-security/#comments</comments>
		<pubDate>Tue, 25 May 2010 01:16:23 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[websites]]></category>

		<guid isPermaLink="false">http://zeroinverse.com/?p=105</guid>
		<description><![CDATA[Just read this article and it has good pointers for anyone putting passwords on their website. http://www.codinghorror.com/blog/2007/09/youre-probably-storing-passwords-incorrectly.html In summary, if<a href="http://zeroinverse.com/2010/05/password-security/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>Just read this article and it has good pointers for anyone putting passwords on their website.</p>
<p>http://www.codinghorror.com/blog/2007/09/youre-probably-storing-passwords-incorrectly.html</p>
<blockquote><p>In summary, <strong>if we&#8217;re storing passwords, we&#8217;re probably storing those passwords incorrectly</strong>. If it isn&#8217;t obvious by now, <a href="http://www.codeproject.com/dotnet/SimpleEncryption.asp">cryptography is hard</a>, and the odds of us getting it right on our own are basically nil. That&#8217;s why we should rely on existing frameworks, and the advice of experts like Thomas. What higher praise is there than that of praise from your sworn enemy?</p>
<p>Let&#8217;s recap:</p>
<ol>
<li><strong>Do not invent your own &#8220;clever&#8221; password storage scheme</strong>. I know, you&#8217;re smart, and you grok this crypto stuff. But through this door lies madness&#8211; and <a href="http://en.wikipedia.org/wiki/LM_hash">abominations like LMHash</a> that have ongoing, worldwide security ramifications we&#8217;re still dealing with today. Take advantage of whatever password storage tools your framework provides, as they&#8217;re likely to be a heck of a lot better tested and more battle-proven than any crazy scheme you and your team can come up with on your own. Security vulnerabilities, unlike functionality bugs in your application, run deep and silent. They can lay dormant for years.</li>
<li><strong>Never store passwords as plaintext</strong>. This feels like security 101 and is completely obvious in retrospect. But not everyone knows what you know &#8212; just ask Reddit. Store the hashes, never the actual passwords. Educate your fellow developers.</li>
<li><strong>Add a long, unique random salt to each password you store</strong>. The point of a salt (or nonce, if you prefer) is to make each password unique and long enough that <a href="http://www.codinghorror.com/blog/archives/000631.html">brute force attacks are a waste of time</a>. So, the user&#8217;s password, instead of being stored as the hash of &#8220;myspace1&#8243;, ends up being stored as the hash of 128 characters of random unicode string + &#8220;myspace1&#8243;. You&#8217;re now completely immune to rainbow table attack.</li>
<li><strong>Use a cryptographically secure hash</strong>. I think Thomas hates MD5 so very much it makes him seem a little crazier than he actually is. But he&#8217;s right. MD5 is vulnerable. Why pick anything remotely vulnerable, when you don&#8217;t have to? SHA-2 or Bcrypt would be a better choice.</li>
</ol>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://zeroinverse.com/2010/05/password-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>End of Corporate Abuse</title>
		<link>http://zeroinverse.com/2010/04/end-of-corporate-abuse/</link>
		<comments>http://zeroinverse.com/2010/04/end-of-corporate-abuse/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 21:22:18 +0000</pubDate>
		<dc:creator>Ron</dc:creator>
				<category><![CDATA[random thoughts]]></category>
		<category><![CDATA[ethics]]></category>
		<category><![CDATA[websites]]></category>

		<guid isPermaLink="false">http://zeroinverse.com/?p=80</guid>
		<description><![CDATA[Recently, I attended an interesting event where Ellie Cachette presented her new web project http://endcorpabuse.com It&#8217;s a great way to<a href="http://zeroinverse.com/2010/04/end-of-corporate-abuse/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p>Recently, I attended an interesting event where Ellie Cachette presented her new web project http://endcorpabuse.com</p>
<p><a href="http://endcorpabuse.com/"><img title="End Corporate Abuse" src="http://endcorpabuse.com/style/images/logo_header.gif" alt="End Corporate Abuse" width="157" height="80" /></a></p>
<p>It&#8217;s a great way to let people share their bad experiences with companies that abuse their power.  In her example, thousands of people were infected with HIV from infected blood from Bayer, a pharmaceutical company.  Instead of recalling the tainted product, they went ahead and sold it, figuring it would be much cheaper to get sued later.  And it was cheaper.  Meanwhile, the families of infected loved ones had to fight for 10+ years in lawsuits to even (1) find out there were thousands of infected people, and (2) to get any recovery.  By then, their loved ones had no doubt suffered.</p>
<p>I&#8217;m glad Ellie came up with a great solution.  It&#8217;s something I have been wanting to see, ways to use social networks and the Internet to stop all the corporate abuse.  This is not about improving customer service or addressing product problems, like GetSatisfaction helps do.  This gives all of us the power to highlight unethical practices of companies.  Imagine how this could have addressed the isseus with Goldman Sachs, AIG, Citibank, GM, and other companies who take advantage of the average American.</p>
<h2>Stop Corporate Abuse!</h2>
]]></content:encoded>
			<wfw:commentRss>http://zeroinverse.com/2010/04/end-of-corporate-abuse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

