<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Solutions Log - Michael Brooks</title>
  <id>http://solutions.michaelbrooks.ca</id>
  <updated>2009-03-12T00:00:00Z</updated>
  <author>
    <name></name>
  </author>
  <entry>
    <title>Useful Bash Keys</title>
    <link href="http://solutions.michaelbrooks.ca/2009/03/12/useful-bash-keys/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/03/12/useful-bash-keys/</id>
    <published>2009-03-12T00:00:00Z</published>
    <updated>2009-03-12T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;A small list of useful (everyday) shortcuts for your BASH shell (terminal).&lt;/p&gt;

&lt;script src="http://gist.github.com/329487.js?file=day-to-day-bash-keys.bash"&gt;&lt;/script&gt;

</summary>
    <content type="html">&lt;p&gt;A small list of useful (everyday) shortcuts for your BASH shell (terminal).&lt;/p&gt;

&lt;script src="http://gist.github.com/329487.js?file=day-to-day-bash-keys.bash"&gt;&lt;/script&gt;

</content>
  </entry>
  <entry>
    <title>Xcode Multiple Values</title>
    <link href="http://solutions.michaelbrooks.ca/2009/07/28/xcode-multiple-values/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/07/28/xcode-multiple-values/</id>
    <published>2009-07-28T00:00:00Z</published>
    <updated>2009-07-28T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;h1&gt;Description&lt;/h1&gt;

&lt;p&gt;Inside the Xcode build properties, some values are displayed as &lt;code&gt;&amp;lt;Multiple Values&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;Incorrect Meaning&lt;/h1&gt;

&lt;p&gt;This can be a little confusing. At first, I thought it meant that the a property contained a list of values&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;h1&gt;Description&lt;/h1&gt;

&lt;p&gt;Inside the Xcode build properties, some values are displayed as &lt;code&gt;&amp;lt;Multiple Values&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;Incorrect Meaning&lt;/h1&gt;

&lt;p&gt;This can be a little confusing. At first, I thought it meant that the a property contained a list of values.&lt;/p&gt;

&lt;h1&gt;Correct Meaning&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;Multiple Values&amp;gt;&lt;/code&gt; means that the &lt;strong&gt;Debug&lt;/strong&gt; and &lt;strong&gt;Release&lt;/strong&gt; builds contain different values for the same property.&lt;/p&gt;

&lt;p&gt;To see the actual value, select one of the build types.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Remote Git Repository</title>
    <link href="http://solutions.michaelbrooks.ca/2009/09/15/remote-git-repository/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/09/15/remote-git-repository/</id>
    <published>2009-09-15T00:00:00Z</published>
    <updated>2009-09-15T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;h1&gt;Server: Create Remote Git Repository&lt;/h1&gt;

&lt;pre&gt;&lt;code&gt;# Repository is just an ordinary directory
mkdir /home/git-data/my_repository.git
&lt;/code&gt;&lt;/pre&gt;
</summary>
    <content type="html">&lt;h1&gt;Server: Create Remote Git Repository&lt;/h1&gt;

&lt;pre&gt;&lt;code&gt;# Repository is just an ordinary directory
mkdir /home/git-data/my_repository.git

# Initialize a bare git repository
cd /home/git-data/my_repository.git
git --bare init
&lt;/code&gt;&lt;/pre&gt;

&lt;h1&gt;Local: Add Remote Repository&lt;/h1&gt;

&lt;pre&gt;&lt;code&gt;cd ~/Documents/Development/my_project/
git remote add origin ssh://user@your-repo-server.com:22/home/user/my_repository.git
git push origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://toolmantim.com/articles/setting_up_a_new_remote_git_repository"&gt;Source&lt;/a&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Git Diff</title>
    <link href="http://solutions.michaelbrooks.ca/2009/09/25/git-diff/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/09/25/git-diff/</id>
    <published>2009-09-25T00:00:00Z</published>
    <updated>2009-09-25T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;A few handy Git diff commands.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git diff --summary master origin/master

git diff --stat master origin/master

git diff --numstat master origin/master
&lt;/code&gt;&lt;/pre&gt;
</summary>
    <content type="html">&lt;p&gt;A few handy Git diff commands.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git diff --summary master origin/master

git diff --stat master origin/master

git diff --numstat master origin/master

git diff --dirstat master origin/master

git diff --shortstat master origin/master

git diff --name-only master origin/master

git diff master origin/master
&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>C++ in Objective-C</title>
    <link href="http://solutions.michaelbrooks.ca/2009/10/05/c-in-objective-c/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/10/05/c-in-objective-c/</id>
    <published>2009-10-05T00:00:00Z</published>
    <updated>2009-10-05T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;h1&gt;Problem&lt;/h1&gt;

&lt;p&gt;How do I compile C++ code in Objective-C / Cocoa.&lt;/p&gt;

&lt;h1&gt;Solution&lt;/h1&gt;

&lt;p&gt;Rename the Objective-C implementation file from &lt;code&gt;*.m&lt;/code&gt; to &lt;code&gt;*.mm&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This tells the Objective-C compiler that it is linking a C++ object&lt;/p&gt;
</summary>
    <content type="html">&lt;h1&gt;Problem&lt;/h1&gt;

&lt;p&gt;How do I compile C++ code in Objective-C / Cocoa.&lt;/p&gt;

&lt;h1&gt;Solution&lt;/h1&gt;

&lt;p&gt;Rename the Objective-C implementation file from &lt;code&gt;*.m&lt;/code&gt; to &lt;code&gt;*.mm&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This tells the Objective-C compiler that it is linking a C++ object&lt;/p&gt;

&lt;h1&gt;Hearsay (Untested)&lt;/h1&gt;

&lt;p&gt;You cannot instantiate a C++ class directly because the constructor and destructor will not fire. Instead, you want to create a pointer and use the &lt;code&gt;new&lt;/code&gt; and &lt;code&gt;delete&lt;/code&gt; methods&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Compile Error: Precompile gcc failed with exit code 1</title>
    <link href="http://solutions.michaelbrooks.ca/2009/10/06/compile-error-precompile-gcc-failed-with-exit-code-1/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/10/06/compile-error-precompile-gcc-failed-with-exit-code-1/</id>
    <published>2009-10-06T00:00:00Z</published>
    <updated>2009-10-06T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;h1&gt;Error Message&lt;/h1&gt;

&lt;pre&gt;&lt;code&gt;Precompile &amp;lt;&amp;lt;precompile header name.pch&amp;gt;&amp;gt;
    Command /Developer/usr/bin/gcc-4.2 failed with exit code 1
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Solution&lt;/p&gt;
</summary>
    <content type="html">&lt;h1&gt;Error Message&lt;/h1&gt;

&lt;pre&gt;&lt;code&gt;Precompile &amp;lt;&amp;lt;precompile header name.pch&amp;gt;&amp;gt;
    Command /Developer/usr/bin/gcc-4.2 failed with exit code 1
&lt;/code&gt;&lt;/pre&gt;

&lt;h1&gt;Solution&lt;/h1&gt;

&lt;p&gt;The Xcode target (or maybe project) configuration may not have the correct precompiled header path.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Right-click on the target and select Get Info&lt;/li&gt;
&lt;li&gt;Select the Build tab&lt;/li&gt;
&lt;li&gt;Select All Configurations&lt;/li&gt;
&lt;li&gt;Go to the section GCC 4.2 Language&lt;/li&gt;
&lt;li&gt;Find the setting Prefix Header&lt;/li&gt;
&lt;li&gt;Check if the path and name are correct.

&lt;ul&gt;
&lt;li&gt;If you have moved your source files into a subfolder inside the project, then include the subfolder in the setting.&lt;/li&gt;
&lt;li&gt;e.g. &lt;code&gt;Sources/MyProject_Prefix.pch&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

</content>
  </entry>
  <entry>
    <title>Default .gitignore</title>
    <link href="http://solutions.michaelbrooks.ca/2009/10/06/default-gitignore/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/10/06/default-gitignore/</id>
    <published>2009-10-06T00:00:00Z</published>
    <updated>2009-10-06T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;Use a &lt;code&gt;.gitignore&lt;/code&gt; file to exclude files and directories from the Git version control system.&lt;/p&gt;

&lt;p&gt;Multiple &lt;code&gt;.gitignore&lt;/code&gt; files can be placed in subdirectories, but it is generally easier to use only one in the root directory, which is where the &lt;code&gt;.git/&lt;/code&gt; directory exists&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;Use a &lt;code&gt;.gitignore&lt;/code&gt; file to exclude files and directories from the Git version control system.&lt;/p&gt;

&lt;p&gt;Multiple &lt;code&gt;.gitignore&lt;/code&gt; files can be placed in subdirectories, but it is generally easier to use only one in the root directory, which is where the &lt;code&gt;.git/&lt;/code&gt; directory exists.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;# Xcode
build/*
*.pbxuser
*.mode1v3

# Subversion
.svn

# OS X
.DS_Store

# Textmate
*.tmproj
&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>Setup Ogre3D Project for Xcode</title>
    <link href="http://solutions.michaelbrooks.ca/2009/10/06/setup-ogre3d-project-for-xcode/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/10/06/setup-ogre3d-project-for-xcode/</id>
    <published>2009-10-06T00:00:00Z</published>
    <updated>2009-10-06T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;&lt;strong&gt;Outdated: Ogre3D 1.6&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new Cocoa project&lt;/li&gt;
&lt;li&gt;Set Base SDK as 1.5 or 1.6&lt;/li&gt;
&lt;li&gt;In &lt;code&gt;Project/Resources&lt;/code&gt; Group

&lt;ol&gt;
&lt;li&gt;Add the directory &lt;code&gt;/Media/&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;

</summary>
    <content type="html">&lt;p&gt;&lt;strong&gt;Outdated: Ogre3D 1.6&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new Cocoa project&lt;/li&gt;
&lt;li&gt;Set Base SDK as 1.5 or 1.6&lt;/li&gt;
&lt;li&gt;In &lt;code&gt;Project/Resources&lt;/code&gt; Group

&lt;ol&gt;
&lt;li&gt;Add the directory &lt;code&gt;/Media/&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;Select the option that creates a single entry in the target&amp;rsquo;s &lt;em&gt;Copy Bundle Resources&lt;/em&gt; (second option)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Add the files &lt;code&gt;/media.cfg, /plugins.cfg, /resources.cfg&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;Make sure these are added to the &lt;em&gt;Copy Bundle Resources&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Add the following linked frameworks to the &lt;code&gt;Project/Frameworks&lt;/code&gt; Group

&lt;ul&gt;
&lt;li&gt;CEGUI.framework&lt;/li&gt;
&lt;li&gt;Cg.framework&lt;/li&gt;
&lt;li&gt;Ogre.framework&lt;/li&gt;
&lt;li&gt;OgreCEGUI.framework&lt;/li&gt;
&lt;li&gt;libois.a&lt;/li&gt;
&lt;li&gt;IOKit.framework&lt;/li&gt;
&lt;li&gt;Cocoa.framework&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Right-click on the target and select &lt;em&gt;Add-&gt;New Build Phase-&gt;New Copy Files Build Phase&lt;/em&gt;

&lt;ul&gt;
&lt;li&gt;Drag the following files into the folder

&lt;ul&gt;
&lt;li&gt;CEGUI.framework&lt;/li&gt;
&lt;li&gt;Cg.framework&lt;/li&gt;
&lt;li&gt;Ogre.framework&lt;/li&gt;
&lt;li&gt;OgreCEGUI.framework&lt;/li&gt;
&lt;li&gt;libois.a&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Target Build Options (Select All Configurations)

&lt;ol&gt;
&lt;li&gt;Architecture: i386

&lt;ul&gt;
&lt;li&gt;This could be x86_64 if Ogre is recompiled under a 64-bit machine&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Framework Search Paths

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;$(SRCROOT)/ExternalFrameworks&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Header Search Paths

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;$(SRCROOT)/ExternalFrameworks/Ogre.framework/Headers&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$(SRCROOT)/ExternalIncludes/OIS&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;OIS needs to have a root directory of OIS, which is why this path has subdirectory called OIS&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$(SRCROOT)/ExternalFrameworks/CEGUI.framework/Headers&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$(SRCROOT)/ExternalIncludes/Samples&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;Required for OgreCEGUIRenderer.h&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Library Search Paths

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;$(SRCROOT)/ExternalLibraries/release&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Enable C++ code inside Objective-C

&lt;ol&gt;
&lt;li&gt;Rename the class implementation file that is going to declare the Ogre3D instance to *.mm&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;

</content>
  </entry>
  <entry>
    <title>Default Function Parameters</title>
    <link href="http://solutions.michaelbrooks.ca/2009/10/07/default-function-parameters/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/10/07/default-function-parameters/</id>
    <published>2009-10-07T00:00:00Z</published>
    <updated>2009-10-07T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;script src="http://gist.github.com/348529.js"&gt;&lt;/script&gt;


&lt;h1&gt;Comments&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Default parameters must be at the end of the function signature.

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;myClass-&amp;gt;print(,,3); // Invalid&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

</summary>
    <content type="html">&lt;script src="http://gist.github.com/348529.js"&gt;&lt;/script&gt;


&lt;h1&gt;Comments&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Default parameters must be at the end of the function signature.

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;myClass-&amp;gt;print(,,3); // Invalid&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Functions with default parameters can be overloaded

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;void print(int value);&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;void print(int value = 10);&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;print() // 10&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Default parameters do not define a unique function

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;void printValues(int value);&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;void printValues(int value, int value2 = 20);&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;printValues(12); // Error: Ambigious call because of default param&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

</content>
  </entry>
  <entry>
    <title>Invoke Super Class Constructor</title>
    <link href="http://solutions.michaelbrooks.ca/2009/10/07/invoke-super-class-constructor/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/10/07/invoke-super-class-constructor/</id>
    <published>2009-10-07T00:00:00Z</published>
    <updated>2009-10-07T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;You need to explicitly invoke the parent class' constructor, otherwise the parent constructor will not fire.&lt;/p&gt;

&lt;script src="http://gist.github.com/348520.js"&gt;&lt;/script&gt;

</summary>
    <content type="html">&lt;p&gt;You need to explicitly invoke the parent class' constructor, otherwise the parent constructor will not fire.&lt;/p&gt;

&lt;script src="http://gist.github.com/348520.js"&gt;&lt;/script&gt;

</content>
  </entry>
  <entry>
    <title>Assertions 101</title>
    <link href="http://solutions.michaelbrooks.ca/2009/10/15/assertions-101/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/10/15/assertions-101/</id>
    <published>2009-10-15T00:00:00Z</published>
    <updated>2009-10-15T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;script src="http://gist.github.com/348509.js"&gt;&lt;/script&gt;

</summary>
    <content type="html">&lt;script src="http://gist.github.com/348509.js"&gt;&lt;/script&gt;

</content>
  </entry>
  <entry>
    <title>Error: C++ forbids declaration with no type</title>
    <link href="http://solutions.michaelbrooks.ca/2009/10/15/error-c-forbids-declaration-with-no-type/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/10/15/error-c-forbids-declaration-with-no-type/</id>
    <published>2009-10-15T00:00:00Z</published>
    <updated>2009-10-15T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;h1&gt;Error Message&lt;/h1&gt;

&lt;pre&gt;&lt;code&gt;Error: C++ forbids declaration with no type
&lt;/code&gt;&lt;/pre&gt;

&lt;h1&gt;Problem&lt;/h1&gt;

&lt;p&gt;There is a circular reference somewhere.&lt;/p&gt;

&lt;p&gt;This can happen if two classes include each other and at least one class declares a member instance of the other&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;h1&gt;Error Message&lt;/h1&gt;

&lt;pre&gt;&lt;code&gt;Error: C++ forbids declaration with no type
&lt;/code&gt;&lt;/pre&gt;

&lt;h1&gt;Problem&lt;/h1&gt;

&lt;p&gt;There is a circular reference somewhere.&lt;/p&gt;

&lt;p&gt;This can happen if two classes include each other and at least one class declares a member instance of the other.&lt;/p&gt;

&lt;h1&gt;Solution&lt;/h1&gt;

&lt;p&gt;If possible, use a forward declaration instead of including the entire class.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;class MyClass;          // Forward declaration
class OtherClass {
public:
    // ...

private:
    MyClass myClass;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If a forward declaration is not possible, then try moving the #include to the implementation file.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Print a Boolean</title>
    <link href="http://solutions.michaelbrooks.ca/2009/10/15/print-a-boolean/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/10/15/print-a-boolean/</id>
    <published>2009-10-15T00:00:00Z</published>
    <updated>2009-10-15T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;h1&gt;C Approach&lt;/h1&gt;

&lt;pre&gt;&lt;code&gt;bool myBoolean = true;
printf("The value is %s", (myBoolean) ? "true" : "false");
// The value is true
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;C++ Approach&lt;/p&gt;
</summary>
    <content type="html">&lt;h1&gt;C Approach&lt;/h1&gt;

&lt;pre&gt;&lt;code&gt;bool myBoolean = true;
printf("The value is %s", (myBoolean) ? "true" : "false");
// The value is true
&lt;/code&gt;&lt;/pre&gt;

&lt;h1&gt;C++ Approach&lt;/h1&gt;

&lt;pre&gt;&lt;code&gt;boolean myBoolean = true;
std::cout &amp;lt;&amp;lt; "The value is " &amp;lt;&amp;lt; myBoolean &amp;lt;&amp;lt; std::endl;
// The value is 1
&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>Standard IO</title>
    <link href="http://solutions.michaelbrooks.ca/2009/10/15/standard-io/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/10/15/standard-io/</id>
    <published>2009-10-15T00:00:00Z</published>
    <updated>2009-10-15T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;h1&gt;C-Library&lt;/h1&gt;

&lt;pre&gt;&lt;code&gt;#include &amp;lt;cstdio&amp;gt;
fprint(stdout, "my string with a number %d", myNumber);
printf("my string with a number %d", myNumber);
&lt;/code&gt;&lt;/pre&gt;
</summary>
    <content type="html">&lt;h1&gt;C-Library&lt;/h1&gt;

&lt;pre&gt;&lt;code&gt;#include &amp;lt;cstdio&amp;gt;
fprint(stdout, "my string with a number %d", myNumber);
printf("my string with a number %d", myNumber);
&lt;/code&gt;&lt;/pre&gt;

&lt;h1&gt;C++ Library&lt;/h1&gt;

&lt;pre&gt;&lt;code&gt;#include &amp;lt;iostream.h&amp;gt;
std::cout &amp;lt;&amp;lt; "hello world" &amp;lt;&amp;lt; std::endl;
&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>Compile Static C++ Library in Xcode 3</title>
    <link href="http://solutions.michaelbrooks.ca/2009/10/30/compile-static-c-library-in-xcode-3/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/10/30/compile-static-c-library-in-xcode-3/</id>
    <published>2009-10-30T00:00:00Z</published>
    <updated>2009-10-30T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;ul&gt;
&lt;li&gt;Create a new BSD Library projector.&lt;/li&gt;
&lt;li&gt;Select static from the drop down menu.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Although Xcode 3 claims that the library is for C code, it will compile C++.&lt;/p&gt;
</summary>
    <content type="html">&lt;ul&gt;
&lt;li&gt;Create a new BSD Library projector.&lt;/li&gt;
&lt;li&gt;Select static from the drop down menu.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Although Xcode 3 claims that the library is for C code, it will compile C++.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>_fopen$Unix2003</title>
    <link href="http://solutions.michaelbrooks.ca/2009/10/30/fopenunix2003/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/10/30/fopenunix2003/</id>
    <published>2009-10-30T00:00:00Z</published>
    <updated>2009-10-30T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;h1&gt;Error Message&lt;/h1&gt;

&lt;p&gt;Compile-time error related to &lt;code&gt;_fopen$Unix2003&lt;/code&gt;.&lt;/p&gt;

&lt;h1&gt;Solution (OS X)&lt;/h1&gt;

&lt;p&gt;In my experience, this is related to using a library compiled with the 10.6 SDK on a project that is compiled with the 10.5 SDK&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;h1&gt;Error Message&lt;/h1&gt;

&lt;p&gt;Compile-time error related to &lt;code&gt;_fopen$Unix2003&lt;/code&gt;.&lt;/p&gt;

&lt;h1&gt;Solution (OS X)&lt;/h1&gt;

&lt;p&gt;In my experience, this is related to using a library compiled with the 10.6 SDK on a project that is compiled with the 10.5 SDK.&lt;/p&gt;

&lt;p&gt;Recompile the library with the lower SDK or compile the projector with the higher SDK.&lt;/p&gt;

&lt;h1&gt;Untested Concern&lt;/h1&gt;

&lt;p&gt;I am not sure if the platform matters (i386 or x64)&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Return value of typeinfo::typeid</title>
    <link href="http://solutions.michaelbrooks.ca/2009/10/31/return-value-of-typeinfotypeid/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/10/31/return-value-of-typeinfotypeid/</id>
    <published>2009-10-31T00:00:00Z</published>
    <updated>2009-10-31T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;h1&gt;Usage&lt;/h1&gt;

&lt;script src="http://gist.github.com/348420.js"&gt;&lt;/script&gt;


&lt;h1&gt;Return Value&lt;/h1&gt;

&lt;p&gt;The return value is defined by the compiler. For example, &lt;code&gt;gcc&lt;/code&gt; returns &lt;code&gt;i&lt;/code&gt; for an int, while a Microsoft compiler may return &lt;code&gt;int&lt;/code&gt;&lt;/p&gt;
</summary>
    <content type="html">&lt;h1&gt;Usage&lt;/h1&gt;

&lt;script src="http://gist.github.com/348420.js"&gt;&lt;/script&gt;


&lt;h1&gt;Return Value&lt;/h1&gt;

&lt;p&gt;The return value is defined by the compiler. For example, &lt;code&gt;gcc&lt;/code&gt; returns &lt;code&gt;i&lt;/code&gt; for an int, while a Microsoft compiler may return &lt;code&gt;int&lt;/code&gt;&lt;/p&gt;

&lt;h1&gt;Unix&lt;/h1&gt;

&lt;p&gt;Objects may have a number prefixed to their name, such as &lt;code&gt;13MyClass&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;People suspect that this is related to the size of the object.&lt;/p&gt;

&lt;h1&gt;Summary&lt;/h1&gt;

&lt;p&gt;While the type name is unique to the class, the number may change if the class is updated with new members or functions.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>std::vector Erase</title>
    <link href="http://solutions.michaelbrooks.ca/2009/11/01/stdvector-erase/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/11/01/stdvector-erase/</id>
    <published>2009-11-01T00:00:00Z</published>
    <updated>2009-11-01T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;&lt;code&gt;std::vector::erase&lt;/code&gt; method does not call the destructor on a data pointer.&lt;/p&gt;

&lt;p&gt;You must delete the pointer yourself after you have erased the data from the vector array.&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;&lt;code&gt;std::vector::erase&lt;/code&gt; method does not call the destructor on a data pointer.&lt;/p&gt;

&lt;p&gt;You must delete the pointer yourself after you have erased the data from the vector array.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Auto UI Color</title>
    <link href="http://solutions.michaelbrooks.ca/2009/11/05/auto-ui-color/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/11/05/auto-ui-color/</id>
    <published>2009-11-05T00:00:00Z</published>
    <updated>2009-11-05T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;Add some quick and easy color to your git output&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git config --global color.ui="auto"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This adds the following line to your &lt;code&gt;~/.gitconfig&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[color]
&lt;/code&gt;&lt;/pre&gt;
</summary>
    <content type="html">&lt;p&gt;Add some quick and easy color to your git output&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git config --global color.ui="auto"
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This adds the following line to your &lt;code&gt;~/.gitconfig&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[color]
    ui = auto
&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>Create and Delete Remote Branches</title>
    <link href="http://solutions.michaelbrooks.ca/2009/11/05/create-and-delete-remote-branches/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/11/05/create-and-delete-remote-branches/</id>
    <published>2009-11-05T00:00:00Z</published>
    <updated>2009-11-05T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;script src="http://gist.github.com/348358.js"&gt;&lt;/script&gt;

</summary>
    <content type="html">&lt;script src="http://gist.github.com/348358.js"&gt;&lt;/script&gt;

</content>
  </entry>
  <entry>
    <title>Modify Previous Commit</title>
    <link href="http://solutions.michaelbrooks.ca/2009/11/05/modify-previous-commit/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/11/05/modify-previous-commit/</id>
    <published>2009-11-05T00:00:00Z</published>
    <updated>2009-11-05T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;h1&gt;Problem&lt;/h1&gt;

&lt;p&gt;Forgot to add the project file to the previous commit.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git commit -m "Created a new context class to manage PolyPlane interaction"
&lt;/code&gt;&lt;/pre&gt;
</summary>
    <content type="html">&lt;h1&gt;Problem&lt;/h1&gt;

&lt;p&gt;Forgot to add the project file to the previous commit.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git commit -m "Created a new context class to manage PolyPlane interaction"
&lt;/code&gt;&lt;/pre&gt;

&lt;h1&gt;Solution&lt;/h1&gt;

&lt;p&gt;Make your corrections and amend the &lt;code&gt;HEAD&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git add my_project_file.proj
git commit -C HEAD --amend
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;code&gt;-C HEAD&lt;/code&gt; uses the commit message from the HEAD (the previous commit)&lt;/p&gt;

&lt;p&gt;&lt;code&gt;--amend&lt;/code&gt; includes the contents of this commit inside the previous commit&lt;/p&gt;

&lt;p&gt;Use &lt;code&gt;-c HEAD&lt;/code&gt; to open editor with previous commit message.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Dealing with End of Lines</title>
    <link href="http://solutions.michaelbrooks.ca/2009/11/08/dealing-with-end-of-lines/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/11/08/dealing-with-end-of-lines/</id>
    <published>2009-11-08T00:00:00Z</published>
    <updated>2009-11-08T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;Strips all carriage-returns (CR) from commits and adds line-feeds (LF) when necessary.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git config --global core.autocrlf input true
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The above command adds the following to your &lt;code&gt;~/.gitconfig&lt;/code&gt;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;Strips all carriage-returns (CR) from commits and adds line-feeds (LF) when necessary.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git config --global core.autocrlf input true
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The above command adds the following to your &lt;code&gt;~/.gitconfig&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[core]
    autocrlf = input
&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>Objective-C Message and Parameter Terminology</title>
    <link href="http://solutions.michaelbrooks.ca/2009/11/14/objective-c-message-and-parameter-terminology/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/11/14/objective-c-message-and-parameter-terminology/</id>
    <published>2009-11-14T00:00:00Z</published>
    <updated>2009-11-14T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;script src="http://gist.github.com/348349.js"&gt;&lt;/script&gt;

</summary>
    <content type="html">&lt;script src="http://gist.github.com/348349.js"&gt;&lt;/script&gt;

</content>
  </entry>
  <entry>
    <title>Tagging</title>
    <link href="http://solutions.michaelbrooks.ca/2009/12/04/tagging/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2009/12/04/tagging/</id>
    <published>2009-12-04T00:00:00Z</published>
    <updated>2009-12-04T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;script src="http://gist.github.com/348315.js"&gt;&lt;/script&gt;

</summary>
    <content type="html">&lt;script src="http://gist.github.com/348315.js"&gt;&lt;/script&gt;

</content>
  </entry>
  <entry>
    <title>Delete App on Palm Device</title>
    <link href="http://solutions.michaelbrooks.ca/2010/04/23/delete-app-on-palm-device/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2010/04/23/delete-app-on-palm-device/</id>
    <published>2010-04-23T00:00:00Z</published>
    <updated>2010-04-23T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;ul&gt;
&lt;li&gt;On the keyboard, hold the red key&lt;/li&gt;
&lt;li&gt;Touch the application to delete&lt;/li&gt;
&lt;/ul&gt;

</summary>
    <content type="html">&lt;ul&gt;
&lt;li&gt;On the keyboard, hold the red key&lt;/li&gt;
&lt;li&gt;Touch the application to delete&lt;/li&gt;
&lt;/ul&gt;

</content>
  </entry>
  <entry>
    <title>MDS-CS HTTP Response Code 413</title>
    <link href="http://solutions.michaelbrooks.ca/2010/05/07/mds-cs-http-response-code-413/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2010/05/07/mds-cs-http-response-code-413/</id>
    <published>2010-05-07T00:00:00Z</published>
    <updated>2010-05-07T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;h1&gt;Problem&lt;/h1&gt;

&lt;p&gt;When using the BlackBerry simulator (in my case JDE 4.6.1) and MDS-CS to make a network request, you receive &lt;code&gt;HTTP 413 "Request entity too large"&lt;/code&gt;. However, using &lt;code&gt;wget&lt;/code&gt; or &lt;code&gt;curl&lt;/code&gt; returns a HTTP 200 response&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;h1&gt;Problem&lt;/h1&gt;

&lt;p&gt;When using the BlackBerry simulator (in my case JDE 4.6.1) and MDS-CS to make a network request, you receive &lt;code&gt;HTTP 413 "Request entity too large"&lt;/code&gt;. However, using &lt;code&gt;wget&lt;/code&gt; or &lt;code&gt;curl&lt;/code&gt; returns a HTTP 200 response.&lt;/p&gt;

&lt;h1&gt;Reason&lt;/h1&gt;

&lt;p&gt;The reason is that the MDS-CS tool limits the bandwidth. If the server response is too large, the MDS-CS tool will replace the response with it&amp;rsquo;s own HTTP 413 response.&lt;/p&gt;

&lt;h1&gt;Solution&lt;/h1&gt;

&lt;p&gt;There is a configuration file that allows you to increase the maximum bandwidth.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;eclipse_dir&amp;gt;\plugins\net.rim.ejde.componentpack4.6.1_4.6.1.36\components\MDS\config\rimpublic.property&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[IPPP]
IPPP.connection.MaxNumberOfKBytesToSend=1024
&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>Change Mac Boot Order on Startup</title>
    <link href="http://solutions.michaelbrooks.ca/2010/05/10/change-mac-boot-order-on-startup/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2010/05/10/change-mac-boot-order-on-startup/</id>
    <published>2010-05-10T00:00:00Z</published>
    <updated>2010-05-10T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;Hold down the &lt;code&gt;option&lt;/code&gt; key while restarting the Mac.&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;Hold down the &lt;code&gt;option&lt;/code&gt; key while restarting the Mac.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Getting Started with Merb on Heroku</title>
    <link href="http://solutions.michaelbrooks.ca/2010/05/10/getting-started-with-merb-on-heroku/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2010/05/10/getting-started-with-merb-on-heroku/</id>
    <published>2010-05-10T00:00:00Z</published>
    <updated>2010-05-10T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;h1&gt;Install Merb&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sudo gem update --system&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sudo gem install merb&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h1&gt;Create a Merb Project&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;merb-gen app myproject&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

</summary>
    <content type="html">&lt;h1&gt;Install Merb&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sudo gem update --system&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sudo gem install merb&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h1&gt;Create a Merb Project&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;merb-gen app myproject&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cd myproject&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bundle install&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;Requires bundler: &lt;code&gt;sudo gem install bundler&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;thin start -R config.ru&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;Requires thin: &lt;code&gt;sudo gem install thin&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;h1&gt;Setup Git Repository&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;cd myproject&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git init&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git add .&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git commit -m "Initial commit"&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h1&gt;Add Heroku Repository&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;git remote add heroku git@heroku.com:myproject.git&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h1&gt;Update Heroku Stack to use Bamboo (Beta)&lt;/h1&gt;

&lt;p&gt;This is required because bundler is the gem manager. Currently, the Bamboo stack is in beta. Heroku provides a &lt;a href="http://docs.heroku.com/bundler"&gt;nice article on bundler&lt;/a&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;View stack options: &lt;code&gt;heroku stack&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Activate the stack: &lt;code&gt;heroku stack:migrate bamboo-ree-1.8.7&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h1&gt;Prepare Gemfile for Heroku Bamboo Stack&lt;/h1&gt;

&lt;p&gt;The Heroku Bamboo stack does have preinstalled gems, so all gems must be declared in the Gemfile. Merb generates a default Gemfile that covers most of the gems. However, Heroku requires a few extras.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Gem Source: &lt;code&gt;source :gemcutter&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Bundler: &lt;code&gt;gem 'bundler', '0.9.20'&lt;/code&gt;

&lt;ul&gt;
&lt;li&gt;Bundler is a tricky one. Each Bamboo stack uses a different bundler version. See the &lt;a href="http://docs.heroku.com/bundler"&gt;heroku bundler article for details&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;SQLite3 for Development&lt;/li&gt;
&lt;li&gt;Postgres for Production&lt;/li&gt;
&lt;/ul&gt;


&lt;script src="http://gist.github.com/396912.js"&gt;&lt;/script&gt;


&lt;h1&gt;Deploy to Heroku&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;git push heroku master&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Open browser to: http://myproject.heroku.com/&lt;/li&gt;
&lt;/ul&gt;

</content>
  </entry>
  <entry>
    <title>Fluid App for Co-op</title>
    <link href="http://solutions.michaelbrooks.ca/2010/05/23/fluid-app-for-co-op/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2010/05/23/fluid-app-for-co-op/</id>
    <published>2010-05-23T00:00:00Z</published>
    <updated>2010-05-23T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;&lt;a href="http://github.com/mwbrooks/co-op_fluid_userscript"&gt;This Fluid userscript&lt;/a&gt; will add a badge to your Co-op Fluid application.&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;&lt;a href="http://github.com/mwbrooks/co-op_fluid_userscript"&gt;This Fluid userscript&lt;/a&gt; will add a badge to your Co-op Fluid application.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Disable Multitasking on iOS 4.x</title>
    <link href="http://solutions.michaelbrooks.ca/2010/10/27/disable-multitasking-on-ios-4x/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2010/10/27/disable-multitasking-on-ios-4x/</id>
    <published>2010-10-27T00:00:00Z</published>
    <updated>2010-10-27T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;By default, when an application is closed on iOS 4.x, it will suspend and not terminate the application.&lt;/p&gt;

&lt;p&gt;You can opt out of suspending the application with a simple &lt;code&gt;Info.plist&lt;/code&gt; setting&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;By default, when an application is closed on iOS 4.x, it will suspend and not terminate the application.&lt;/p&gt;

&lt;p&gt;You can opt out of suspending the application with a simple &lt;code&gt;Info.plist&lt;/code&gt; setting.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open your Xcode project&lt;/li&gt;
&lt;li&gt;Open Info.plst&lt;/li&gt;
&lt;li&gt;Add a new entry with the following KEY:VALUE pair &lt;code&gt;UIApplicationExitsOnSuspend : YES&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

</content>
  </entry>
  <entry>
    <title>Upgrade BlackBerry OS</title>
    <link href="http://solutions.michaelbrooks.ca/2010/12/08/upgrade-blackberry-os/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2010/12/08/upgrade-blackberry-os/</id>
    <published>2010-12-08T00:00:00Z</published>
    <updated>2010-12-08T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;h1&gt;Approach 1: Avoid Desktop Manager&lt;/h1&gt;

&lt;h2&gt;Requirements&lt;/h2&gt;

&lt;p&gt;Download &amp;amp; install the &lt;a href="http://us.blackberry.com/apps-software/desktop/"&gt;BlackBerry Device Manager software&lt;/a&gt;&lt;/p&gt;
</summary>
    <content type="html">&lt;h1&gt;Approach 1: Avoid Desktop Manager&lt;/h1&gt;

&lt;h2&gt;Requirements&lt;/h2&gt;

&lt;p&gt;Download &amp;amp; install the &lt;a href="http://us.blackberry.com/apps-software/desktop/"&gt;BlackBerry Device Manager software&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Unlock Device&lt;/h2&gt;

&lt;p&gt;Delete &lt;code&gt;C:\Program Files (x86)\Common Files\Research In Motion\AppLoader\Vendor.xml&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you do not delete this file, then the software will only install if it matches your device&amp;rsquo;s carrier/vendor.&lt;/p&gt;

&lt;h2&gt;Upgrade Device&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Connect your device via USB&lt;/li&gt;
&lt;li&gt;Open the &lt;code&gt;C:\Program Files (x86)\Common Files\Research In Motion\AppLoader\Loader.exe&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Click next many times&lt;/li&gt;
&lt;/ol&gt;


&lt;h1&gt;Approach 2: Use Desktop Manager&lt;/h1&gt;

&lt;h2&gt;Requirements&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Download &amp;amp; install the &lt;a href="http://us.blackberry.com/apps-software/desktop/"&gt;BlackBerry Device Manager software&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Download &amp;amp; install the &lt;a href="http://us.blackberry.com/support/downloads/download_sites.jsp"&gt;BlackBerry device software&lt;/a&gt; (e.g. OS 6.0.0.337 for 9800)&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;Unlock Device&lt;/h2&gt;

&lt;p&gt;Delete &lt;code&gt;C:\Program Files (x86)\Common Files\Research In Motion\AppLoader\Vendor.xml&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If you do not delete this file, then the software will only install if it matches your device&amp;rsquo;s carrier/vendor.&lt;/p&gt;

&lt;h2&gt;Upgrade Device&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Connect your device via USB&lt;/li&gt;
&lt;li&gt;Open the &lt;em&gt;BlackBerry Device Manager&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Click &lt;em&gt;Device&lt;/em&gt; &amp;ndash;&gt; &lt;em&gt;Upgrade Device Software&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;h1&gt;Troubleshooting&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;During the upgrade, I receive the following error: One of more modules could not be resolved&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the installed application&amp;rsquo;s on your device is causing this problem. My solution was to remove all software from the device using the &lt;em&gt;Application&lt;/em&gt; section of the &lt;em&gt;Device Manager.&lt;/em&gt;&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Kill BlackBerry Simulator</title>
    <link href="http://solutions.michaelbrooks.ca/2011/01/30/kill-blackberry-simulator/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2011/01/30/kill-blackberry-simulator/</id>
    <published>2011-01-30T00:00:00Z</published>
    <updated>2011-01-30T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;On Windows Vista x64 and Windows 7 x64, I have trouble closing the BlackBerry 4.x and 5.x simulators.&lt;/p&gt;

&lt;p&gt;In the end, the only way to close it is by killing the task&amp;hellip;&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;On Windows Vista x64 and Windows 7 x64, I have trouble closing the BlackBerry 4.x and 5.x simulators.&lt;/p&gt;

&lt;p&gt;In the end, the only way to close it is by killing the task.&lt;/p&gt;

&lt;p&gt;To speed the whole process up, I use a &lt;code&gt;kill-blackberry.bat&lt;/code&gt; file that I shortcut to my desktop or quick launch bar.&lt;/p&gt;

&lt;script src="https://gist.github.com/537194.js?file=kill_bb_simulator.bat"&gt;&lt;/script&gt;


&lt;p&gt;Happy task killing!&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Disable Telephone Detection in PhoneGap-iOS</title>
    <link href="http://solutions.michaelbrooks.ca/2011/02/09/disable-telephone-detection-in-phonegap-ios/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2011/02/09/disable-telephone-detection-in-phonegap-ios/</id>
    <published>2011-02-09T00:00:00Z</published>
    <updated>2011-02-09T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;The iPhone&amp;rsquo;s Mobile Safari can automatically detect and link telephone numbers.&lt;/p&gt;

&lt;h2&gt;Disable Telephone Detection in Mobile Safari&lt;/h2&gt;
</summary>
    <content type="html">&lt;p&gt;The iPhone&amp;rsquo;s Mobile Safari can automatically detect and link telephone numbers.&lt;/p&gt;

&lt;h2&gt;Disable Telephone Detection in Mobile Safari&lt;/h2&gt;

&lt;p&gt;For mobile web applications, you can disable telephone number detection with &lt;code&gt;&amp;lt;meta name="format-detection" content="telephone=no" /&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;Disable Telephone Detection in UIWebView&lt;/h2&gt;

&lt;p&gt;PhoneGap instantiates a browser using the &lt;a href="http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebView_Class/Reference/Reference.html"&gt;UIWebView Class&lt;/a&gt;. Unfortunately, &lt;code&gt;UIWebView&lt;/code&gt; ignores &lt;code&gt;&amp;lt;meta name="format-detection" content="telephone=no" /&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For PhoneGap-iPhone / PhoneGap-iOS applications, you can disable telephone number detection by adding the following to your project&amp;rsquo;s application delegate:&lt;/p&gt;

&lt;script src="https://gist.github.com/819020.js?file=MyProjectAppDelegate.m"&gt;&lt;/script&gt;

</content>
  </entry>
  <entry>
    <title>Open external links in Safari.app</title>
    <link href="http://solutions.michaelbrooks.ca/2011/02/15/open-external-links-in-safariapp/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2011/02/15/open-external-links-in-safariapp/</id>
    <published>2011-02-15T00:00:00Z</published>
    <updated>2011-02-15T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;By default, PhoneGap-iOS opens external links within the PhoneGap WebView. This is a terrible default action because there are no navigation buttons within PhoneGap. A simple solution is to open the external links in&amp;hellip; the external browser!&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;By default, PhoneGap-iOS opens external links within the PhoneGap WebView. This is a terrible default action because there are no navigation buttons within PhoneGap. A simple solution is to open the external links in&amp;hellip; the external browser!&lt;/p&gt;

&lt;p&gt;Given an external link such as:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;http://www.github.com/mwbrooks
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;When I am using PhoneGap-iOS.&lt;/p&gt;

&lt;p&gt;When I want to open the link in the main browser (Safari.app).&lt;/p&gt;

&lt;p&gt;Then add the following to the application delegate (&lt;code&gt;myproject/Classes/myprojectAppDelegate.m&lt;/code&gt;):&lt;/p&gt;

&lt;script src="https://gist.github.com/827979.js?file=projectAppDelegate.m"&gt;&lt;/script&gt;

</content>
  </entry>
  <entry>
    <title>Remove iOS text field input shadow</title>
    <link href="http://solutions.michaelbrooks.ca/2011/02/22/remove-ios-text-field-input-shadow/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2011/02/22/remove-ios-text-field-input-shadow/</id>
    <published>2011-02-22T00:00:00Z</published>
    <updated>2011-02-22T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;By default, the iOS WebView will add a top shadow to &lt;code&gt;&amp;lt;input /&amp;gt;&lt;/code&gt; elements.&lt;/p&gt;

&lt;script src="https://gist.github.com/839216.js?file=style.css"&gt;&lt;/script&gt;

</summary>
    <content type="html">&lt;p&gt;By default, the iOS WebView will add a top shadow to &lt;code&gt;&amp;lt;input /&amp;gt;&lt;/code&gt; elements.&lt;/p&gt;

&lt;script src="https://gist.github.com/839216.js?file=style.css"&gt;&lt;/script&gt;

</content>
  </entry>
  <entry>
    <title>Remove Tap Highlight from Mobile Webkit</title>
    <link href="http://solutions.michaelbrooks.ca/2011/02/23/remove-tap-highlight-from-mobile-webkit/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2011/02/23/remove-tap-highlight-from-mobile-webkit/</id>
    <published>2011-02-23T00:00:00Z</published>
    <updated>2011-02-23T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;On various elements, such as &lt;code&gt;&amp;lt;input type="checkbox" /&amp;gt;&lt;/code&gt;, a highlight is applied on touch hold.&lt;/p&gt;

&lt;script src="https://gist.github.com/840928.js?file=style.css"&gt;&lt;/script&gt;

</summary>
    <content type="html">&lt;p&gt;On various elements, such as &lt;code&gt;&amp;lt;input type="checkbox" /&amp;gt;&lt;/code&gt;, a highlight is applied on touch hold.&lt;/p&gt;

&lt;script src="https://gist.github.com/840928.js?file=style.css"&gt;&lt;/script&gt;

</content>
  </entry>
  <entry>
    <title>Hide StatusBar on iOS</title>
    <link href="http://solutions.michaelbrooks.ca/2011/06/30/hide-statusbar-on-ios/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2011/06/30/hide-statusbar-on-ios/</id>
    <published>2011-06-30T00:00:00Z</published>
    <updated>2011-06-30T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;A PhoneGap-iOS application is just a regular Xcode iOS project.&lt;/p&gt;

&lt;h2&gt;Hide Status Bar by Configuration&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open your Xcode project &lt;code&gt;MyApp.xcodeproj&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Open your project&amp;rsquo;s pList file &lt;code&gt;MyApp-Info.plist&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

</summary>
    <content type="html">&lt;p&gt;A PhoneGap-iOS application is just a regular Xcode iOS project.&lt;/p&gt;

&lt;h2&gt;Hide Status Bar by Configuration&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open your Xcode project &lt;code&gt;MyApp.xcodeproj&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Open your project&amp;rsquo;s pList file &lt;code&gt;MyApp-Info.plist&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Add a new row (right-click &amp;ndash;&gt; Add Row)

&lt;ul&gt;
&lt;li&gt;Key: &amp;ldquo;Status bar is initially hidden&amp;rdquo; (&lt;code&gt;UIStatusBarHidden&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Value: &lt;code&gt;YES&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;h2&gt;Hide Status Bar Programmatically&lt;/h2&gt;

&lt;pre&gt;&lt;code&gt;[UIApplication sharedApplication].statusBarHidden = YES;
&lt;/code&gt;&lt;/pre&gt;
</content>
  </entry>
  <entry>
    <title>Android Soft Keyboard Resizes Web View</title>
    <link href="http://solutions.michaelbrooks.ca/2011/07/05/android-soft-keyboard-resizes-web-view/" rel="alternate"/>
    <id>http://solutions.michaelbrooks.ca/2011/07/05/android-soft-keyboard-resizes-web-view/</id>
    <published>2011-07-05T00:00:00Z</published>
    <updated>2011-07-05T00:00:00Z</updated>
    <author>
      <name></name>
    </author>
    <summary type="html">&lt;p&gt;The default behaviour of Android is to resize the web view when the
soft keyboard is displayed. This can cause undesirable behaviour when your PhoneGap&lt;/p&gt;
</summary>
    <content type="html">&lt;p&gt;The default behaviour of Android is to resize the web view when the
soft keyboard is displayed. This can cause undesirable behaviour when your PhoneGap
application has elements positioned as &lt;code&gt;fixed&lt;/code&gt; or &lt;code&gt;absolute&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Normal Web View:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="/images/articles/tweetgap-default.png" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Soft Keyboard Resizes Web View:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="/images/articles/tweetgap-resize.png" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Desired Result:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src="/images/articles/tweetgap-pan.png" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to your Android application directory&lt;/li&gt;
&lt;li&gt;Open &lt;code&gt;AndroidManifest.xml&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add &lt;code&gt;android:windowSoftInputMode="adjustPan&lt;/code&gt; to &lt;code&gt;&amp;lt;activity&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;  &amp;lt;!-- Before --&amp;gt;
  &amp;lt;activity android:configChanges="orientation|keyboardHidden" android:label="@string/app_name" android:name="PhotoGap"&amp;gt;

  &amp;lt;!-- After --&amp;gt;
  &amp;lt;activity android:configChanges="orientation|keyboardHidden" android:windowSoftInputMode="adjustPan" android:label="@string/app_name" android:name="PhotoGap"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The &lt;a href="http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft"&gt;Android Developer Guides have good documentation&lt;/a&gt; for &lt;code&gt;android:windowSoftInputMode&lt;/code&gt;&lt;/p&gt;
</content>
  </entry>
</feed>

