<?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>Kickass Labs &#187; noob</title>
	<atom:link href="http://www.kickasslabs.com/tag/noob/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kickasslabs.com</link>
	<description>We &#9829; code.</description>
	<lastBuildDate>Sun, 04 Jul 2010 03:00:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Quick Hits: Becareful when returning inc&#8217;ed vars</title>
		<link>http://www.kickasslabs.com/2010/05/01/quick-hits-becareful-when-returning-inced-vars/</link>
		<comments>http://www.kickasslabs.com/2010/05/01/quick-hits-becareful-when-returning-inced-vars/#comments</comments>
		<pubDate>Sat, 01 May 2010 05:01:44 +0000</pubDate>
		<dc:creator>abel</dc:creator>
				<category><![CDATA[MonoTouch]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Quick Hits]]></category>
		<category><![CDATA[gotcha]]></category>
		<category><![CDATA[noob]]></category>

		<guid isPermaLink="false">http://www.kickasslabs.com/?p=473</guid>
		<description><![CDATA[I noticed this in some MonoTouch code that I wrote recently, but I think it makes sense across other languages as well.  Let&#8217;s say you write a method that returns an incremented variable like this:
private int MyAwesomeFunction(int pVar)
{
// coding magic
  return pVar++;
}
&#8230;where pVar = 10, the returned value will NOT be 11!  The returned [...]]]></description>
			<content:encoded><![CDATA[<p>I noticed this in some MonoTouch code that I wrote recently, but I think it makes sense across other languages as well.  Let&#8217;s say you write a method that returns an incremented variable like this:</p>
<p><span style="color: #0000ff;">private int</span> MyAwesomeFunction(int pVar)<br />
{<br />
<span style="color: #008000;">// coding magic</span><br />
<span style="color: #008000;"> <span style="color: #0000ff;"> return</span></span> pVar++;<br />
}</p>
<p>&#8230;where pVar = 10, the returned value will NOT be 11!  The returned value will still be 10.  If you want to return an incremented value for pVar, do the following:</p>
<p><code><span style="color: #0000ff;">private  int</span> MyAwesomeFunction(int pVar)<br />
{<br />
<span style="color: #008000;">//  coding magic</span></code><br />
<code> <span style="color: #0000ff;">return <span style="color: #000000;">++</span></span>pVar; <span style="color: #008000;">// or </span></code><span style="color: #008000;"><code>return   pVar+1</code></span>;<br />
<code>}</code></p>
<p>Just a case of postfix vs prefix.  In the previous example, the variable never gets incremented because the postfix operator would get evaluated after the line is processed, but that never happens because we&#8217;re returning the pVar.  By flipping to a prefix operator, we guarantee that we evaluate the opperator against the variable before we return it.</p>
<p>It&#8217;s also worth mentioning that being a little verbose here is also good.  Explicitly stating that you&#8217;re adding 1 to the variable (as displayed in the commented code) is the same number of characters and we eliminate the confusion over what&#8217;s getting returned.</p>
<p>Happy Coding!</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.kickasslabs.com%2F2010%2F05%2F01%2Fquick-hits-becareful-when-returning-inced-vars%2F&amp;linkname=Quick%20Hits%3A%20Becareful%20when%20returning%20inc%26%238217%3Bed%20vars"><img src="http://www.kickasslabs.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.kickasslabs.com/2010/05/01/quick-hits-becareful-when-returning-inced-vars/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quick Hits:  When your .gitignore file gets&#8230;ignored</title>
		<link>http://www.kickasslabs.com/2010/02/06/quick-hits-when-your-gitignore-file-gets-ignored/</link>
		<comments>http://www.kickasslabs.com/2010/02/06/quick-hits-when-your-gitignore-file-gets-ignored/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 19:55:48 +0000</pubDate>
		<dc:creator>abel</dc:creator>
				<category><![CDATA[Version Control]]></category>
		<category><![CDATA[GIT]]></category>
		<category><![CDATA[noob]]></category>

		<guid isPermaLink="false">http://www.kickasslabs.com/?p=427</guid>
		<description><![CDATA[I made a mistake while creating a GIT repos that I&#8217;m hoping I can save you from making.  I made my first commit on a project and I realized that a bunch of files were getting in that shouldn&#8217;t be.  I created a .gitignore file, but the issue kept happening on subsequent commits.  As I [...]]]></description>
			<content:encoded><![CDATA[<p>I made a mistake while creating a GIT repos that I&#8217;m hoping I can save you from making.  I made my first commit on a project and I realized that a bunch of files were getting in that shouldn&#8217;t be.  I created a .gitignore file, but the issue kept happening on subsequent commits.  As I learned later, you SHOULD create your .gitignore file first.  However, if you forgot, this is how you fix it:</p>
<ol>
<li>Keep your .gitignore file.</li>
<li>Clear your GIT cache.  Don&#8217;t worry, this won&#8217;t delete any of your  local files, just what GIT is tracking.<br />
<code>git rm -r --cached .</code></li>
<li>Add everything in your project.  Your .gitignore file will exclude what you want to ignore now and start tracking the good stuff.<br />
<code>git add .</code></li>
<li>Commit your changes.<br />
<code>git commit -m "Now my .gitignore file works correctly!"</code></li>
</ol>
<p>Happy codding!</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.kickasslabs.com%2F2010%2F02%2F06%2Fquick-hits-when-your-gitignore-file-gets-ignored%2F&amp;linkname=Quick%20Hits%3A%20%20When%20your%20.gitignore%20file%20gets%26%238230%3Bignored"><img src="http://www.kickasslabs.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.kickasslabs.com/2010/02/06/quick-hits-when-your-gitignore-file-gets-ignored/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I LOVE MonoTouch</title>
		<link>http://www.kickasslabs.com/2010/01/24/i-love-monotouch/</link>
		<comments>http://www.kickasslabs.com/2010/01/24/i-love-monotouch/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 22:42:47 +0000</pubDate>
		<dc:creator>abel</dc:creator>
				<category><![CDATA[MonoTouch]]></category>
		<category><![CDATA[noob]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.kickasslabs.com/?p=415</guid>
		<description><![CDATA[Don't get me wrong, XCode is great...in it's own way...but as a .Net dev coming to the iPhone platform, MonoTouch rocks my world!
For the other devs in my shoes looking to play with MonoTouch, here are some things to keep in mind:]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t get me wrong, XCode is great&#8230;in it&#8217;s own way&#8230;but as a .Net dev coming to the iPhone platform, <a href="http://monotouch.net/" target="_blank">MonoTouch</a> rocks my world!</p>
<p>For the other devs in my shoes looking to play with <a href="http://monotouch.net/" target="_blank">MonoTouch</a>, here are some things to keep in mind:<span id="more-415"></span></p>
<ul>
<li>If you want to subclass something like UIView, UIImageView, or any class that&#8217;s originally an Objective-C class &amp; use your new class in your  XIB, you need to&#8230;
<ul>
<li>Make sure your constructor includes IntPtr constructor.</li>
<li>Sometimes you&#8217;ll need to register your classes like this:
<pre>[MonoTouch.Foundation.Register("MyAwesomeView")]
public class MyAwesomeView : UIView
{
   public MyAwesomeView (IntPtr handle) : base(handle)
   {
      Initialize ();
   }
   //My awesome code here!
}
</pre>
</li>
<li>If you simply type in the name of your custom subclassed view into IB without declaring it in code first, sometimes you get a &#8220;partial class&#8221; in the view controller&#8217;s xib code-behind file (MySensationalViewController.xib.designer.cs).  If that happens, you <strong>DON&#8217;T</strong> need to register your class, but you <strong>DO</strong> need to set your class definition to &#8216;partial&#8217;.  Here&#8217;s an example:
<pre>public partial class MyFantasticView : UIView
{
   public MyFantasticView  (IntPtr handle) : base(handle)
   {
      Initialize ();
   }
   //Your awesome code here!
}</pre>
</li>
</ul>
</li>
<li>Much like Visual Studio, you get awesome debugging tools so make sure to get familiar with &#8220;watches&#8221; (While at  break point: View -&gt; Debug Windows -&gt; Watch) and the &#8220;Expression Evaluator&#8221; (While at  break point: Run -&gt; Expression Evaluator).</li>
<li>There are also helpful tools such as a &#8220;Reg-Ex Toolkit&#8221; and an &#8220;Add-in&#8221; manager that can be hooked into repositories for even more functionality&#8230;as more repositories become available <img src='http://www.kickasslabs.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<p>When you have a friendly, yet powerful IDE to work with, developing software becomes enjoyable.  I&#8217;ll definitely be using this IDE to create my first iPhone app submission to the AppStore.  As I learn more about MonoTouch, I&#8217;ll make sure to post my findings here.  In the meanwhile, those of you looking to get more info about MonoTouch should checkout <a href="http://monotouch.net/" target="_blank">its homepage</a>.  The MonoTouch site has a ton of tutorials, documentation, and multiple ways to plug into the MT community.  At a glance, you might scoff at the asking price of $399 for a yearly license, but when you consider how much faster you&#8217;ll be able to put together quality apps, it might be worth it for you.   I know it is for me.</p>
<p>Happy Coding!</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.kickasslabs.com%2F2010%2F01%2F24%2Fi-love-monotouch%2F&amp;linkname=I%20LOVE%20MonoTouch"><img src="http://www.kickasslabs.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.kickasslabs.com/2010/01/24/i-love-monotouch/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FasterCSV and noob-ish silliness</title>
		<link>http://www.kickasslabs.com/2009/03/23/fastercsv-and-noob-ish-silliness/</link>
		<comments>http://www.kickasslabs.com/2009/03/23/fastercsv-and-noob-ish-silliness/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 03:44:52 +0000</pubDate>
		<dc:creator>abel</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Quick Hits]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[fastercsv]]></category>
		<category><![CDATA[noob]]></category>

		<guid isPermaLink="false">http://www.kickasslabs.com/?p=238</guid>
		<description><![CDATA[Here are two things I discovered this weekend:
Thing 1: FasterCSV is really cool!  It&#8217;s easy to use and does exactly what it should.  Here&#8217;s Scott Becker&#8217;s exporting tutorial.  For importing, i&#8217;ve hacked together bits from Peter Larkmund&#8217;s travels and the FasterCSV documentation.  Thanks to these tutorials, AMB will give users the ability to upload and [...]]]></description>
			<content:encoded><![CDATA[<p>Here are two things I discovered this weekend:</p>
<p><strong>Thing 1:</strong> <a href="http://fastercsv.rubyforge.org/" target="_blank">FasterCSV</a> is really cool!  It&#8217;s easy to use and does exactly what it should.  Here&#8217;s Scott Becker&#8217;s <a href="http://synthesis.sbecker.net/articles/2007/06/07/how-to-generate-csv-files-in-rails" target="_blank">exporting tutorial</a>.  For importing, i&#8217;ve hacked together bits from Peter Larkmund&#8217;s <a href="http://marklunds.com/articles/one/310" target="_blank">travels</a> and the FasterCSV <a href="http://fastercsv.rubyforge.org/classes/FasterCSV.html" target="_blank">documentation</a>.  Thanks to these tutorials, <a href="http://www.am-budget.com" target="_blank">AMB</a> will give users the ability to upload and export CSVs.</p>
<p><strong>Thing 2:</strong> Default values for the win!  If you have a table that has a column for an amount, feel free to set the default value to 0.00.  Otherwise you won&#8217;t be able to do the following:</p>
<p>a = Account.new<br />
a.amount += 20</p>
<p>&#8230;because a.amount will be nil.  You&#8217;ll throw an error and if you just updated a bunch of code, you might waste an hour trying to figure out why you&#8217;re throwing an exception.  However, if you declare a default value, you&#8217;ll be able to avoid any issues.</p>
<p>If you want me to go into further detail on either thing, just leave a comment.</p>
<p>Thanks for reading and happy hacking.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.kickasslabs.com%2F2009%2F03%2F23%2Ffastercsv-and-noob-ish-silliness%2F&amp;linkname=FasterCSV%20and%20noob-ish%20silliness"><img src="http://www.kickasslabs.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.kickasslabs.com/2009/03/23/fastercsv-and-noob-ish-silliness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
