<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">
  <id>tag:samsoff.es,2005:/blog</id>
  <link rel="alternate" type="text/html" href="http://samsoff.es" />
  
  <title>samsoff.es</title>
  <updated>2012-01-27T04:17:00-06:00</updated>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/samsoffes/blog" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="samsoffes/blog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
    <id>tag:samsoff.es,2005:Post/106</id>
    <published>2012-01-27T04:17:30-06:00</published>
    <updated>2012-01-27T04:32:35-06:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/on-managing-money" />
    <title>On Managing Money</title>
    <content type="html">&lt;p&gt;I generally suck at managing money. My usual attitude to paying for anything is "I need this, so here is the money." When people ask me how much things cost, I never know. &lt;em&gt;This is stupid.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;I've kinda of brainwashed myself into thinking I don't have a choice except to pay for this. Doing pretty well as a software engineer in San Francisco makes this a possibility. I realize how stupid this is.&lt;/p&gt;&lt;p&gt;Anyway, I'm starting to &lt;em&gt;hopefully&lt;/em&gt; break the habit.&lt;/p&gt;&lt;h3&gt;Progress&lt;/h3&gt;&lt;p&gt;Monthly subscriptions seemed like a logical place to start. I had a ton of services I have been paying for and either not using at all or could easily go without. Here's a list of services I canceled or downgraded tonight:&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;Netflix - watching less TV now&lt;/li&gt;
&lt;li&gt;Hulu - watching less TV now&lt;/li&gt;
&lt;li&gt;GitHub - not using pay features&lt;/li&gt;
&lt;li&gt;Zipcar - not using any more&lt;/li&gt;
&lt;li&gt;Railscasts - really love, but can go without for now&lt;/li&gt;
&lt;li&gt;Vimeo - not using any more&lt;/li&gt;
&lt;li&gt;Flickr - not using any more&lt;/li&gt;
&lt;li&gt;Dropbox - started using Rdio, so no longer need the extra space for iTunes syncing&lt;/li&gt;
&lt;li&gt;Xbox Live - rarely use and can go without&lt;/li&gt;
&lt;li&gt;Rdio - switched from a family plan&lt;/li&gt;
&lt;li&gt;DNSMadeEasy - switched to a cheaper service&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I was pretty proud of the big dent I made in my wasted spending. &lt;em&gt;That's $930 in savings a year. Not bad.&lt;/em&gt;&lt;/p&gt;&lt;h3&gt;Do It.&lt;/h3&gt;&lt;p&gt;This is a great exercise. I just went through my bank statements and identified as many of these subscriptions as possible. The yearly ones are obviously harder to find, but you get the idea. &lt;em&gt;Anyway, if you suck at managing money, this is a good place to start. Highly recommend.&lt;/em&gt;&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/105</id>
    <published>2012-01-23T17:26:20-06:00</published>
    <updated>2012-01-23T17:27:03-06:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/uitableviewcell-silly-magic" />
    <title>UITableViewCell Silly Magic</title>
    <content type="html">&lt;p&gt;Ever had a &lt;code&gt;UITableViewCell&lt;/code&gt;'s &lt;code&gt;imageView&lt;/code&gt; not update when you set it's &lt;code&gt;image&lt;/code&gt; in a callback or block? It's amazingly frustrating. I usually end up going over and over the code to make sure it sets it on the main thread, the image isn't &lt;code&gt;nil&lt;/code&gt;, the image view is on the screen, etc, etc.&lt;/p&gt;&lt;h3&gt;The Problem&lt;/h3&gt;&lt;p&gt;&lt;code&gt;UITableViewCell&lt;/code&gt;s don't update when you set the &lt;code&gt;imageView&lt;/code&gt;'s &lt;code&gt;image&lt;/code&gt;. &lt;code&gt;UITableViewCell&lt;/code&gt;'s &lt;code&gt;imageView&lt;/code&gt; is magical and stupid. If you don't have an image in the &lt;code&gt;imageView&lt;/code&gt;, it will nil it out and remove it from the &lt;code&gt;contentView&lt;/code&gt;. When you set the image, it will cache it and do some silliness so your updates don't work. &lt;/p&gt;&lt;h3&gt;The Solution&lt;/h3&gt;&lt;p&gt;&lt;em&gt;Make your own image view.&lt;/em&gt; Easy as that. Don't use the &lt;code&gt;imageView&lt;/code&gt; property unless you want it to work exactly the way Apple uses it in Music.app for albums. For anything else, just make your own and add it to the &lt;code&gt;contentView&lt;/code&gt;.&lt;/p&gt;&lt;p&gt;Trust me, you'll save yourself hours of frustration.&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/104</id>
    <published>2011-11-10T01:37:32-06:00</published>
    <updated>2011-11-10T01:38:39-06:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/always-initialize-to-nil" />
    <title>Always Initialize to Nil</title>
    <content type="html">&lt;p&gt;Here's an excerpt from &lt;a href="http://ryfar.com/post/12591151308/initialize"&gt;a great blog post&lt;/a&gt; on why you should always initialize your variables to &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“Always initailize your object variables to nil, no matter what, because some day they may be captured by a block and if they contain junk when the block is copied you’re going to crash.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;p&gt;It's just good practice, but this really sums it up. Thanks for the write up &lt;a href="http://twitter.com/ryfar"&gt;Ryan Perry&lt;/a&gt;!&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/103</id>
    <published>2011-10-31T13:04:38-05:00</published>
    <updated>2011-11-01T11:58:14-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/open-source-is-rewarding" />
    <title>Open Source is Rewarding</title>
    <content type="html">&lt;p&gt;I released &lt;a href="http://sstoolk.it"&gt;SSToolkit&lt;/a&gt; awhile ago. It's an open source library for doing common things in iOS. It's the overflow of stuff that I use on a daily basis. It's pretty much everything I've ever written that is iOS related that is reusable, open sourced, and released for free.&lt;/p&gt;&lt;p&gt;I recently received this email from a developer using my framework.&lt;/p&gt;&lt;blockquote&gt;
&lt;p&gt;Dear Sam&lt;/p&gt;

&lt;p&gt;Thank you for SSToolkit. I'm using it to display images from a folder.&lt;/p&gt;

&lt;p&gt;your code is easy to use and the instructions to import it into an Xcode project, on your website, are clear and simple.&lt;/p&gt;

&lt;p&gt;Regards&lt;br&gt;
Ehab&lt;/p&gt;
&lt;/blockquote&gt;&lt;p&gt;Totally made my day. &lt;span class="gray"&gt;Here's &lt;a href="https://github.com/samsoffes/ssziparchive/issues/7"&gt;another example&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/101</id>
    <published>2011-10-30T16:46:36-05:00</published>
    <updated>2011-10-30T16:46:36-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/my-deploy-script" />
    <title>My Deploy Script</title>
    <content type="html">&lt;p&gt;Here's my basic rake task I use to deploy my blog:&lt;/p&gt;&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="n"&gt;desc&lt;/span&gt; &lt;span class="s1"&gt;'Deploy to Heroku and push to GitHub'&lt;/span&gt;
&lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="ss"&gt;:deploy&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="k"&gt;unless&lt;/span&gt; &lt;span class="sb"&gt;`git status -s`&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
    &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s1"&gt;'WARNING: There are uncommitted changes'&lt;/span&gt;
    &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s1"&gt;'Commit any changes before deploying.'&lt;/span&gt;
    &lt;span class="nb"&gt;exit&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="sb"&gt;`git push origin master`&lt;/span&gt;
  &lt;span class="sb"&gt;`git push heroku master`&lt;/span&gt;
  &lt;span class="sb"&gt;`heroku run rake assets:precompile`&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Notice I run &lt;code&gt;rake assets:precompile&lt;/code&gt; after I deploy to &lt;a href="http://heroku.com"&gt;Heroku&lt;/a&gt;. I am using &lt;a href="https://github.com/rumblelabs/asset_sync"&gt;asset_sync&lt;/a&gt; to host my assets on S3 instead of Heroku. There is a known issue with Heroku and this gem, so that's my workaround. Having it in my little rake task means I won't forget any more :)&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/100</id>
    <published>2011-10-30T15:08:13-05:00</published>
    <updated>2011-10-30T17:36:10-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/how-to-install-ruby-193" />
    <title>How to Install Ruby 1.9.3</title>
    <content type="html">&lt;p&gt;I'm a fan of living on the edge. Ruby 1.9.3 &lt;a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/40527"&gt;just came out&lt;/a&gt; today. It's apparently really stable as well!&lt;/p&gt;&lt;blockquote&gt;
&lt;p&gt;We've been running it in all our 1.9 deployments for GC tuning + require speed fix.&lt;/p&gt;

&lt;p&gt;— &lt;a href="https://twitter.com/dhh/status/130731723750244352"&gt;David Heinemeier Hansson&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;&lt;h3&gt;Installing rbenv&lt;/h3&gt;&lt;p&gt;Installing Ruby 1.9.3 is easy. My preferred approach is using &lt;a href="https://github.com/sstephenson/rbenv"&gt;rbenv&lt;/a&gt; and &lt;a href="https://github.com/sstephenson/ruby-build"&gt;ruby-build&lt;/a&gt; by &lt;a href="https://github.com/sstephenson"&gt;Sam Stephenson&lt;/a&gt; (great name, I know). rbenv makes it easy to have multiple versions of Ruby on your system (and in a much cleaner way than &lt;a href="http://beginrescueend.com/"&gt;rvm&lt;/a&gt;).&lt;/p&gt;&lt;p&gt;If you are running Xcode 4.2, you'll need to install GCC since Xcode no longer ships with &lt;a href="http://gcc.gnu.org/"&gt;GCC&lt;/a&gt; (in favor of the far superior &lt;a href="http://llvm.org/"&gt;LLVM&lt;/a&gt;). You can download an installer &lt;a href="https://github.com/kennethreitz/osx-gcc-installer/downloads"&gt;here&lt;/a&gt;. Once you get GCC installed, you can run the following commands to get rbenv and ruby-build installed. You'll need Homebrew if you don't already have it. (I &lt;strong&gt;highly&lt;/strong&gt; recommend it.)&lt;/p&gt;&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;brew update
&lt;span class="nv"&gt;$ &lt;/span&gt;brew install rbenv
&lt;span class="nv"&gt;$ &lt;/span&gt;brew install ruby-build
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can also use &lt;a href="https://github.com/samsoffes/dotfiles"&gt;my dot files&lt;/a&gt; or &lt;a href="https://github.com/sstephenson/rbenv#section_2.1"&gt;install without Homebrew&lt;/a&gt; instead if you'd like.&lt;/p&gt;&lt;h3&gt;Installing Ruby&lt;/h3&gt;&lt;p&gt;Once you have rbenv and ruby-build installed, you can run the following command to get Ruby 1.9.3 installed.&lt;/p&gt;&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;rbenv install 1.9.3-p0
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;Easy as that!&lt;/em&gt; It will take a few minutes to download everything and compile. Now if you'd like to use 1.9.3 by default, you can run the following command:&lt;/p&gt;&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;rbenv global 1.9.3-p0
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Done! Now enjoy the and improved Ruby on your system! It's greatly improved over Ruby 1.9.2 with some nice speed improvements. If you have any problems with your new setup, I'd recommend reading over the &lt;a href="https://github.com/sstephenson/rbenv#readme"&gt;rbenv readme&lt;/a&gt;.&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/99</id>
    <published>2011-10-28T13:34:18-05:00</published>
    <updated>2011-10-28T16:04:25-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/genius-launch" />
    <title>Genius Launch</title>
    <content type="html">&lt;p&gt;&lt;a href="http://www.everlane.com/i/f8leoo"&gt;Everlane&lt;/a&gt; is a new startup that started here in San Francisco. They've done some ridiculously smart things with their launch.&lt;/p&gt;&lt;blockquote&gt;
&lt;p&gt;With Everlane we've set out to build a new kind of retail experience, one that exists 100% online and bypasses all the middlemen to create beautiful designer goods, always under $100.&lt;/p&gt;
&lt;/blockquote&gt;&lt;p&gt;It's basically super high quality designer goods (clothes, ties, bags, etc). I kinda want all of it.&lt;/p&gt;&lt;h3&gt;Genius Part&lt;/h3&gt;&lt;p&gt;So besides having stuff that I really want and a great design, they have a &lt;em&gt;brilliant social sharing incentive&lt;/em&gt;.&lt;/p&gt;&lt;p&gt;&lt;img src="http://assets.samsoff.es/posts/genius-launch/everlane.png" alt="Everlane Screenshot"&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;It's simple really. If you want to see more, you have to &lt;a href="http://www.everlane.com/i/f8leoo"&gt;invite friends&lt;/a&gt; to get access. You only need to invite one. Simple as that.&lt;/p&gt;&lt;p&gt;If you want more awesome stuff like early access, a &lt;a href="http://www.everlane.com/i/f8leoo"&gt;&lt;em&gt;free shirt&lt;/em&gt;&lt;/a&gt;, a $50 credit, or free shipping for life, you just need to get more friends to join. &lt;em&gt;This is so smart.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Retweet contests and such are stupid. Usually it's an iPad for a prize. Apple &lt;a href="http://daringfireball.net/linked/2011/10/18/aapl-q4-2011"&gt;sold 11.2 million iPads last quarter&lt;/a&gt;. I already have one. It's so much better to simply invite my friends to something intriguing and pretty to get stuff that I can't get without inviting people &lt;span class="gray"&gt;and it's stuff that I really want&lt;/span&gt;.&lt;/p&gt;&lt;p&gt;Anyway, I was impressed. You should &lt;a href="http://www.everlane.com/i/f8leoo"&gt;check it out&lt;/a&gt; and experience this really great idea.&lt;/p&gt;&lt;p&gt;&lt;span class="gray"&gt;And yes this post was partly so I could &lt;a href="http://soff.me/BMiF"&gt;see this&lt;/a&gt;. I'm okay with that.&lt;/span&gt;&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/98</id>
    <published>2011-10-27T21:05:36-05:00</published>
    <updated>2011-10-27T21:16:20-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/make-ichat-better" />
    <title>Make iChat Better</title>
    <content type="html">&lt;p&gt;I really love &lt;a href="http://www.apple.com/macosx/apps/all.html#ichat"&gt;iChat&lt;/a&gt;. I think it's a billion times better than &lt;a href="http://adium.im/"&gt;Adium&lt;/a&gt; &lt;span class="gray"&gt;in my opinion&lt;/span&gt;. Bonjour alone is really fantastic. Plus, iChat is super gorgeous and Adium is definitely not.&lt;/p&gt;&lt;p&gt;Anyway, there are a few preferences that I really recommend turning on to make iChat way better. To see your iChat preference, choose "iChat" from the menu bar, then "Preferences". Everything I'm going to cover is in the "Messages" tab, but there are definitely a lot of other fun things to tweak if that's your thing.&lt;/p&gt;&lt;p&gt;&lt;img src="http://assets.samsoff.es/posts/make-ichat-better/ichat-prefs.png" alt="iChat Preferences"&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;First, &lt;em&gt;Save chat transcripts&lt;/em&gt;. Enable this preference to save all of your chat transcripts (duh). This is great (especially if you're using AIM since there is no way to get your logs online anywhere). I recommend choosing a folder in your &lt;a href="https://www.dropbox.com/referrals/NTY3Nzk3OQ"&gt;Dropbox&lt;/a&gt; if you have multiple computers so you can see history in multiple places.&lt;/p&gt;&lt;p&gt;The next preference is my favorite: &lt;em&gt;In new chat windows, show the last 25 messages&lt;/em&gt;. This is really great. You can close chats when you're done with them and not worry about forgetting what someone was saying. I constantly get people asking me to send them something again or are confused because they don't remember the context of our conversation. I highly recommend this one.&lt;/p&gt;&lt;p&gt;Finally, &lt;em&gt;Collect chats in a single window&lt;/em&gt;. This may already be on, but if it's not, definitely turn it on. Now, instead of having a ton of chat windows, you get a really nice looks chat window that has a list of people you're talking to with their picture. It's really fantastic.&lt;/p&gt;&lt;p&gt;Anyway, hopefully that helps you make your chatting more enjoyable. Enjoy!&lt;/p&gt;&lt;blockquote&gt;
&lt;p&gt;By the way, &lt;a href="http://verbs.im/"&gt;Verbs&lt;/a&gt; is hands down the most fantastic chat client for iPhone and iPad. Highly recommend.&lt;/p&gt;
&lt;/blockquote&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/97</id>
    <published>2011-10-26T23:37:11-05:00</published>
    <updated>2011-10-26T23:42:19-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/easy-syntax-highlighting" />
    <title>Easy Syntax Highlighting</title>
    <content type="html">&lt;p&gt;Syntax highlight in Ruby is annoying. &lt;a href="http://pygments.org/"&gt;Pygments&lt;/a&gt; is the best way to do syntax highlighting, but it's a Python project. (Why no one has ported that to Ruby yet is beyond me. Granted there are a few, but they are all kinda annoying, slow, or don't work that well.)&lt;/p&gt;&lt;p&gt;Anyway, for awhile the best way was to hit a &lt;a href="http://pygments-1-4.appspot.com/"&gt;web service running on App Engine&lt;/a&gt; to use Pygments since that's actually running Python. This totally sucks because you have to rely on that service—it could be down, network latency, etc.&lt;/p&gt;&lt;p&gt;&lt;a href="https://github.com/djanowski"&gt;Damian Janowski&lt;/a&gt; put out a fantastic gem that solves this called &lt;a href="https://github.com/djanowski/pygmentize"&gt;Pygmentize&lt;/a&gt;. It's dead simple to use too.&lt;/p&gt;&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s2"&gt;"pygmentize"&lt;/span&gt;
&lt;span class="n"&gt;source&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"function foo() { return 'bar'; }"&lt;/span&gt;
&lt;span class="no"&gt;Pygmentize&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;process&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:javascript&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;em&gt;The best part about all of this is that you can run it on Heroku!&lt;/em&gt; I &lt;a href="https://github.com/samsoffes/samsoff.es/commit/5bf2aa733d020caad897960a133055110e545ea5#L2R14"&gt;switched my blog to use it&lt;/a&gt; and it's working great. By the way, if you're using Heroku, be sure you use the &lt;a href="http://devcenter.heroku.com/articles/cedar"&gt;Cedar Stack&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Here's my &lt;strong&gt;&lt;a href="http://pygmentize-example.herokuapp.com"&gt;little example page running on Heroku&lt;/a&gt;&lt;/strong&gt;. The full source is &lt;a href="https://github.com/samsoffes/pygmentize-example"&gt;on GitHub&lt;/a&gt; too. Enjoy!&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/95</id>
    <published>2011-10-20T13:21:48-05:00</published>
    <updated>2011-10-21T15:02:23-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/face-detection-at-hipstamatic" />
    <title>Face Detection at Hipstamatic</title>
    <content type="html">&lt;p&gt;Since I joined the ranks at Hipstamatic &lt;a href="http://samsoff.es/posts/hey-synthetic"&gt;a few months ago&lt;/a&gt;, I've been working on a lot of different things (including some really exciting new stuff I'll be able to show off in a few weeks).&lt;/p&gt;&lt;h3&gt;HipstaProcessor&lt;/h3&gt;&lt;p&gt;My first big project here was refactoring all of our image processing from &lt;a href="http://hipstamatic.com"&gt;Hipstamatic&lt;/a&gt;, &lt;a href="http://incredibooth.com"&gt;IncrediBooth&lt;/a&gt;, and some upcoming stuff into a library that we can reuse called HipstaProcessor.&lt;/p&gt;&lt;p&gt;This has been a great project. HipstaProcessor runs on iOS and Mac (which I was pretty proud of). This gives us the ability to test out effects quickly as we build them instead of the tedious  process of change the effects, putting a build on the device, and testing with whatever images are on the device.&lt;/p&gt;&lt;p&gt;Also, having all of our image processing code in one place makes for lots of reuse of tested and solid code instead of recreating the wheel every time we need to process an image in an app (which is kinda our thing).&lt;/p&gt;&lt;h3&gt;Face Detection&lt;/h3&gt;&lt;p&gt;Apple added &lt;a href="http://developer.apple.com/library/ios/#documentation/CoreImage/Reference/CIDetector_Ref/Reference/Reference.html"&gt;&lt;code&gt;CIDetector&lt;/code&gt;&lt;/a&gt; in iOS 5, which is really fantastic. It allows you to find faces in images. Here's a really basic example:&lt;/p&gt;&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="c1"&gt;// Use high quality detection&lt;/span&gt;
&lt;span class="n"&gt;NSDictionary&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;detectorOptions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;NSDictionary&lt;/span&gt; &lt;span class="nl"&gt;dictionaryWithObjectsAndKeys:&lt;/span&gt;
                                 &lt;span class="n"&gt;CIDetectorAccuracyHigh&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;CIDetectorAccuracy&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                                 &lt;span class="nb"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;// Create the detector&lt;/span&gt;
&lt;span class="n"&gt;CIDetector&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;detector&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;CIDetector&lt;/span&gt; &lt;span class="nl"&gt;detectorOfType:&lt;/span&gt;&lt;span class="n"&gt;CIDetectorTypeFace&lt;/span&gt; &lt;span class="nl"&gt;context:&lt;/span&gt;&lt;span class="n"&gt;ciContext&lt;/span&gt; &lt;span class="nl"&gt;options:&lt;/span&gt;&lt;span class="n"&gt;detectorOptions&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="c1"&gt;// Loop through all of the faces it found&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;CIFeature&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;feature&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;detector&lt;/span&gt; &lt;span class="nl"&gt;featuresInImage:&lt;/span&gt;&lt;span class="n"&gt;ciImage&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// Simply draw a solid color in the face's rect&lt;/span&gt;
    &lt;span class="c1"&gt;// Obviously you could do something much more interesting&lt;/span&gt;
    &lt;span class="n"&gt;CGContextFillRect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;feature&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;bounds&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It's actually a lot easier than I thought it would be. It works by finding two eyes and other face features. For people with hair that covers one eye, it won't see them. It also does a pretty poor job at finding people with darker skin, especially in low light.&lt;/p&gt;&lt;p&gt;Since we already had HipstaProcessor going in IncrediBooth, it was easy to simply add face detection to HipstaProcessor and then get it in IncrediBooth instantly. Pretty great stuff.&lt;/p&gt;&lt;h3&gt;Haus O' Haunt&lt;/h3&gt;&lt;p&gt;&lt;a href="http://itunes.apple.com/app/incredibooth/id378754705?mt=8" rel="external nofollow"&gt;&lt;img src="http://assets.samsoff.es/posts/face-detection-at-hipstamatic/haunt-sample.jpg" alt="Haus O' Haunt Sample" style="float:left;padding:0.25em 1em 1em 0"&gt;&lt;/a&gt; In &lt;a href="http://itunes.apple.com/app/incredibooth/id378754705?mt=8"&gt;IncrediBooth 1.3&lt;/a&gt; (which comes out October 21st) &lt;em&gt;we added a new booth called Haus O' Haunt&lt;/em&gt; that features face detection (among some other new fun effects). This is our Halloween booth, and we went crazy making some spooky effects. It was a really fun time, and I think the effects turned out really great!&lt;/p&gt;&lt;p&gt;The first setting in the booth, called Markup, randomly finds some of the faces and chooses a random marker stroke to place over the face. It's really fun to watch it in action!&lt;/p&gt;&lt;p&gt;So &lt;a href="http://itunes.apple.com/app/incredibooth/id378754705?mt=8"&gt;checkout IncrediBooth&lt;/a&gt; to see Haus O' Haunt and all of the other new fun effects!&lt;/p&gt;&lt;h3&gt;The Future&lt;/h3&gt;&lt;p&gt;It's pretty nuts how easy this is now. I remember thinking that face detection is forever away and super hard to do unless you have tons of engineers. It's amazing that Apple has opened this up to everyone. I'm really excited about things to come!&lt;/p&gt;&lt;p&gt;By the way, we're hiring at Hipstamatic. Email me if you want to make some cool iOS or Rails awesomeness: &lt;a href="mailto:sam@synth.tc"&gt;&lt;/a&gt;&lt;a href="mailto:sam@synth.tc"&gt;sam@synth.tc&lt;/a&gt;&lt;/p&gt;&lt;blockquote&gt;
&lt;p&gt;Here's 2 promo codes for IncrediBooth. Hopefully you can snag one and enjoy it for free if you don't already have it! (Only the first two to redeem them get it.)&lt;/p&gt;

&lt;p&gt;E3FXNXAPY4PJ&lt;br&gt;
N7WJY6PEXKWJ&lt;/p&gt;
&lt;/blockquote&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/96</id>
    <published>2011-10-20T14:01:08-05:00</published>
    <updated>2011-10-20T14:01:08-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/removed-facebook-comments" />
    <title>Removed Facebook Comments</title>
    <content type="html">&lt;p&gt;Sorry if you left some comments. I appreciate it, but it wasn't really a good solution. They weren't that pretty, loaded slow, and didn't notify me when people posted. I had no way to track comments on my posts.&lt;/p&gt;&lt;p&gt;I might build something, but now, I'll just go back to no comments. If you want to leave a comment or ask a question, I'm &lt;a href="http://twitter.com/samsoffes"&gt;@samsoffes on Twitter&lt;/a&gt;. You can always &lt;a href="mailto:sam@samsoff.es"&gt;email me&lt;/a&gt; too.&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/93</id>
    <published>2011-09-06T22:39:54-05:00</published>
    <updated>2011-09-10T16:11:05-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/the-worst-recruiters" />
    <title>The Worst Recruiters</title>
    <content type="html">&lt;p&gt;The &lt;a href="http://andiamo-group.com/"&gt;Andiamo Group&lt;/a&gt; is the worst recruiting group I have ever encountered. I have asked them repeatedly to stop emailing me and they will not. Their "job leads" are always uninteresting and often irrelevant to my skill set.&lt;/p&gt;&lt;p&gt;I sent this email as my last reply from Mark that I received on September 6. I doubt it will be successful, but I thought I'd share my truly awful experience with them.&lt;/p&gt;&lt;blockquote&gt;
&lt;p&gt;Daniel from your company first contacted me on March 31. Jens contacted me on April 29 and I politely asked him to remove me from your list and to not contact me again. Daniel then emailed me again on May 11. You then emailed me on May 18. Daniel emailed me again on May 12 and I replied for him to please stop emailing me. Daniel emailed me again on June 21 and I replied again asking him to stop emailing me. You emailed me again on August 3.&lt;/p&gt;

&lt;p&gt;Please, please, please stop emailing me.&lt;/p&gt;

&lt;p&gt;Sam&lt;/p&gt;
&lt;/blockquote&gt;&lt;p&gt;If you are using a recruiting firm (which I hope you aren't and I'll go into that more in the future) please don't use this group of, in my opinion, disrespectful "professionals".&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/92</id>
    <published>2011-08-28T22:25:06-05:00</published>
    <updated>2011-09-10T16:11:05-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/how-to-rock-at-craigs-list" />
    <title>How To Rock at Craig's List</title>
    <content type="html">&lt;p&gt;Not to brag, but &lt;em&gt;I rock at selling stuff on Craig's List&lt;/em&gt;. I often sell things for close to what I paid for them. A &lt;a href="http://twitter.com/sammcd"&gt;few friends&lt;/a&gt; can vouch for my Craig's List skills.&lt;/p&gt;&lt;p&gt;Anyway, it's easy to sell stuff to rock at Craig's List. Here's a few things to think about.&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;&lt;p&gt;List stuff for a bit higher than what you want to get for it. People always offer lower than the listed price. This gives you room to go down the price you actually want.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Be firm with what you're willing to accept. People will usually respect that.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;People usually email asking if the item is available. When you reply, say that is (if it is of course) and ask when they want to meet. Making the transaction as soon as possible is key. Waiting gives them time to change their mind, find something cheaper, or whatever else.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If there are other people interested, I always mention that. People knowing that other people might get it before they can makes them move faster. I've had people cancel dinner plans and come meet me to buy something because they didn't want to lose the chance to buy the item.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Only accept cash. If anyone won't pay with cash, they are trying to scam you. (While we're on scamming, if anyone ever offers to pay more than what you're asking, that is definitely a scam.)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;People love stuff in the original box and when you say what cables are included and such.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Good photos are a must.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Keep descriptions short and to the point. People rarely read them anyway.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I'm sure there's more stuff, but that's a good start. Once I started selling stuff on Craig's List, I got hooked. It's an awesome feeling selling crap you don't need and getting cash. I paid the downpayment on my last car with  all cash from Craig's List sales. Pretty cool.&lt;/p&gt;&lt;p&gt;By the way, one of &lt;a href="http://twitter.com/stevederico"&gt;my friends&lt;/a&gt; has a great app for browsing Craig's List &lt;a href="http://itunes.apple.com/us/app/craigslist/id457406375?mt=8"&gt;on the App Store&lt;/a&gt;.&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/91</id>
    <published>2011-08-24T17:45:23-05:00</published>
    <updated>2011-09-10T16:11:05-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/hey-synthetic" />
    <title>Hey, Synthetic</title>
    <content type="html">&lt;p&gt;As of September 1st, I will be working at &lt;a href="http://heysynthetic.com"&gt;Synthetic&lt;/a&gt;, the makers of &lt;a href="http://hipstamatic.com/"&gt;Hipstamatic&lt;/a&gt;! You may remember, &lt;a href="http://samsoff.es/posts/hipstamatic"&gt;I was contracting there&lt;/a&gt;, but now I'm no longer a freelancer and a full time employee. My title will be Lead iOS Engineer. I'm way excited. We are working  on some really, really exciting stuff.&lt;/p&gt;&lt;p&gt;It's really cool to be a part of something instead of a hired gun. The decision was easy. This is an amazing place to work. I really can't wait for our releases coming up! We will blow some minds.&lt;/p&gt;&lt;p&gt;If you wanna work on some awesome too, we're hiring iOS and Rails engineers. Email me: &lt;a href="mailto:sam@synth.tc"&gt;&lt;/a&gt;&lt;a href="mailto:sam@synth.tc"&gt;sam@synth.tc&lt;/a&gt;&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/90</id>
    <published>2011-08-21T23:07:58-05:00</published>
    <updated>2011-09-10T16:11:05-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/notebooks" />
    <title>Notebooks</title>
    <content type="html">&lt;p&gt;I've found whenever I get stuck on something hard, notebooks help. There is something about writing stuff down in a notebook that really helps me think.&lt;/p&gt;&lt;p&gt;Whiteboards are fun and all, but I think they are a little more distracting than useful when you're working by yourself. All of the setup required to just put your thoughts down is a bit much most of the time. Once you're done at the whiteboard, then you have to figure out a way to save your thoughts so you can reference them later. Don't get me wrong, great when brainstorming in a group, but I've found they are way less productive than a notebook when working a lone.&lt;/p&gt;&lt;p&gt;My favorite notebook is the &lt;a href="http://www.creativesoutfitter.com/Products/Dot-Grid-Book/9"&gt;Behance Dot Grid Book&lt;/a&gt; (only $14). It's super high quality. I'm a big fan. (I also really like &lt;a href="http://www.amazon.com/Moleskine-Square-Notebook-Pocket/dp/888370102X/ref=sr_1_1?ie=UTF8&amp;amp;qid=1313986191&amp;amp;sr=8-1"&gt;Moleskin&lt;/a&gt; too.) The &lt;a href="http://www.amazon.com/Pilot-Retractable-Roller-Barrel-12-Count/dp/B00006JNJ8"&gt;Pilot G2 Pen&lt;/a&gt; is my all time favorite pen. I've used it exclusively (when possible) since 2007.&lt;/p&gt;&lt;p&gt;It's really great to flip through past notebooks and see cool things I designed or problems I struggled through that were once really hard that are now easy. Most of my doodles are abstract drawings, UI wireframes, or lists of elements of a problem. I've found I get to a solution fastest by simply listing all of the parts of the problem. It also really helps to simply list (in sentences even) what I will do to solve it.&lt;/p&gt;&lt;p&gt;For some reason, this is so much more effective to me than opening &lt;a href="http://macromates.com"&gt;TextMate&lt;/a&gt; and doing the same thing. Anyway, I recommend trying this. It has helped me countless times over the years.&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/89</id>
    <published>2011-07-24T16:16:52-05:00</published>
    <updated>2011-09-10T16:36:06-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/compass-and-rails-3-1" />
    <title>Compass and Rails 3.1</title>
    <content type="html">&lt;p&gt;Here's how I finally got Compass working with Rails 3.1rc4 (with includes, sprites, etc).&lt;/p&gt;&lt;p&gt;Gemfile excerpt:&lt;/p&gt;&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="n"&gt;gem&lt;/span&gt; &lt;span class="s1"&gt;'sass-rails'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:git&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'https://github.com/rails/sass-rails.git'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:ref&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'031236b31eaf20658226a9ae051749cc6647c33f'&lt;/span&gt;
&lt;span class="n"&gt;gem&lt;/span&gt; &lt;span class="s1"&gt;'compass'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:git&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'https://github.com/chriseppstein/compass.git'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:ref&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'2c1fcfcad708875d10db65740aabf417abc636a6'&lt;/span&gt;
&lt;span class="n"&gt;gem&lt;/span&gt; &lt;span class="s1"&gt;'sprockets'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'2.0.0.beta.10'&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;config/compass.rb excerpt:&lt;/p&gt;&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="n"&gt;http_images_path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'/assets/'&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;That's it.&lt;/strong&gt; You don't have to do any of the crazy initializer hacks or anything like that. (If you were doing that, you can remove it all). The rest of my Gemfile and compass.rb are just standard stuff. Here's my &lt;a href="https://gist.github.com/1103112#file_full_compass.rb"&gt;full compass.rb&lt;/a&gt; if that helps though.&lt;/p&gt;&lt;p&gt;The only other thing you'll need to do is be sure all of your stylesheets are in &lt;code&gt;app/assets/stylesheets/&lt;/code&gt; and end in &lt;code&gt;.css.scss&lt;/code&gt; or &lt;code&gt;.css.sass&lt;/code&gt;. Eventually you won't have to include the &lt;code&gt;.css&lt;/code&gt; part if you don't want to, but for now, it's required (due to Sprockets).&lt;/p&gt;&lt;p&gt;Big thanks to &lt;a href="http://twitter.com/jmccartie"&gt;Jon McCartie&lt;/a&gt; and &lt;a href="http://twitter.com/chriseppstein"&gt;&lt;br&gt;
Chris Eppstein&lt;/a&gt; for all of their help!&lt;/p&gt;&lt;h3&gt;Update: Rails 3.1.0.rc5&lt;/h3&gt;&lt;p&gt;Rails 3.1.0.rc5 just came out. Here's the updates for rc5.&lt;/p&gt;&lt;p&gt;Gemfile excerpt:&lt;/p&gt;&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="n"&gt;gem&lt;/span&gt; &lt;span class="s1"&gt;'sass-rails'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:git&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'https://github.com/rails/sass-rails.git'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:ref&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'231b14da040c3ad320076cbaaa70190d14b95d37'&lt;/span&gt;
&lt;span class="n"&gt;gem&lt;/span&gt; &lt;span class="s1"&gt;'compass'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:git&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'https://github.com/chriseppstein/compass.git'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:ref&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s1"&gt;'33263caffe5548a64253976c0a034afe1ed567f4'&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;That's it!&lt;/strong&gt; Your compass.rb remains the same as before with &lt;code&gt;http_images_path&lt;/code&gt;. You don't need to add &lt;code&gt;.css&lt;/code&gt; to partials' file names any more now!&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/88</id>
    <published>2011-07-20T13:12:28-05:00</published>
    <updated>2011-09-10T16:11:05-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/hipstamatic" />
    <title>Hipstamatic</title>
    <content type="html">&lt;p&gt;Lately I've been working with &lt;a href="http://heysynthetic.com"&gt;Hipstamatic&lt;/a&gt; on a new really exciting product. I can't really say any more than that, but it's going to be awesome.&lt;/p&gt;&lt;p&gt;&lt;a href="http://heysynthetic.com" class="bordered-image" style="border:0;width:300px;height:300px"&gt;&lt;img src="http://assets.samsoff.es/posts/hipstamatic/hipstaoffice.jpg" alt="Hipstaoffice"&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I've been having a lot of fun learning about image processing. Who knew writing your own &lt;a href="http://en.wikipedia.org/wiki/Gaussian_blur"&gt;gaussian blur&lt;/a&gt; was really hard?&lt;/p&gt;&lt;p&gt;It's kind of a perfect setup for me right now. Their office is 2 blocks from my apartment and everyone is super awesome to work with. It's also great being a contractor. All of the freedoms that come with that are really great.&lt;/p&gt;&lt;p&gt;Hopefully, I'll be able to post a little of what I've been working on in a few months. &lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/87</id>
    <published>2011-07-02T12:38:15-05:00</published>
    <updated>2011-09-10T16:11:05-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/moving-on" />
    <title>Moving On</title>
    <content type="html">&lt;p&gt;Yesterday, Scribd submitted the app I've been working on for the last 6 months. It's been really great working with everyone. It was also my last day at Scribd. Now that the project is done, I'm moving on to something else.&lt;/p&gt;&lt;h3&gt;What Will You Be Doing?&lt;/h3&gt;&lt;p&gt;&lt;em&gt;Nothing!&lt;/em&gt; Taking some time off to rest after working crazy hours to finish the project. I have a pretty exciting contract gig I'll be starting soon that will last for a few months that will be a lot of fun. I have a few interviews at some pretty cool places, but I'm not in a hurry to get a real job again.&lt;/p&gt;&lt;h3&gt;Haven't You Done This Before?&lt;/h3&gt;&lt;p&gt;Sigh, yes. This will be the third time I have moved to being a full-time contractor. Yes, I hated it in the past. Yes, I've said that I won't hate it this time around before. Yes, I probably will hate it in a few months :) Anyway, I'm excited. I want to focus on my &lt;a href="http://cheddarapp.com"&gt;own projects&lt;/a&gt; more this time around.&lt;/p&gt;&lt;p&gt;It's funny how not a big deal this is to me. I've changed jobs and moved a lot lately the last few years. It's almost being normal. Hopefully I'll settle down one of these days. For now, I plan on staying in San Francisco for a bit. We'll see what happens on that front though.&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/86</id>
    <published>2011-05-14T13:11:25-05:00</published>
    <updated>2011-09-10T16:11:05-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/four-years" />
    <title>Four Years</title>
    <content type="html">&lt;p&gt;I choose not to attend college. During my senior year of high school, I was co-oping (half day at school finishing my required classes and a half day at work). When I graduated in 2007 (I hope I just made you feel old) I transitioned to a full time salary employee. I always thought that getting a salary job with benefits was the entire point of going to college, but I enrolled anyway.&lt;/p&gt;&lt;h3&gt;Almost Going&lt;/h3&gt;&lt;p&gt;As starting college approached, I soon realized I would have to spend almost all of my free time driving from work to school, sitting in classes, and doing homework. I was totally dreading this. I wasn't a good student in high school and didn't want any part of the busy work, writing papers, and all of that nonsense.&lt;/p&gt;&lt;p&gt;My mother really wanted me to go because neither of my parents went, so I said I'd stick it out and go. A few months later, I got a job offer from &lt;a href="http://lifechurch.tv"&gt;LifeChurch.tv&lt;/a&gt; in Oklahoma City and decided to take it. Obviously, I would have to drop out of the University of Louisville where I was enrolled since I would be moving away. Trying to keep my promise to my mom, I enrolled in Phoenix.edu.&lt;/p&gt;&lt;p&gt;I took two classes at Phoenix (both of which were completely worthless) before I moved. After I moved to Oklahoma, AT&amp;amp;T didn't hook up my internet when they were supposed to, so I postponed starting and eventually canceled it all together.&lt;/p&gt;&lt;h3&gt;Instead&lt;/h3&gt;&lt;p&gt;&lt;em&gt;Today would have been my graduation day if I had stayed&lt;/em&gt;, but instead of graduating, I did some other stuff. I'll give a brief summary of what I did. I'm going to include personal stuff as well as work related stuff since life is much more than just work.&lt;/p&gt;&lt;h4&gt;2007&lt;/h4&gt;&lt;p&gt;Worked for a local entrepreneur creating a YouTube rip off. Never launched.&lt;/p&gt;&lt;p&gt;Did my first freelance project creating a CMS/website builder in my free time. The project paid $5,000 and I thought I was on top of the world. I really made next to nothing if you look at all of the time I spent on it, but I became a much better programmer in the process.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;March:&lt;/strong&gt; Turned 18.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;May:&lt;/strong&gt; Graduated high school.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;June:&lt;/strong&gt; Started a salary job at &lt;a href="http://southeastchristian.org"&gt;Southeast Christian Church&lt;/a&gt; in Louisville, KY making almost nothing. I mainly doing high-end video and lighting work at the church. Starting doing a few websites in PHP while I was there.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;November:&lt;/strong&gt; Received a job offer from LifeChurch.tv that required me to move to Oklahoma City.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;December:&lt;/strong&gt; Got engaged to my high school sweetheart.&lt;/p&gt;&lt;h4&gt;2008&lt;/h4&gt;&lt;p&gt;&lt;strong&gt;January:&lt;/strong&gt; Moved from Kentucky to Oklahoma to start working at LifeChurch.tv.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;March:&lt;/strong&gt; iPhone SDK announced. Started working on &lt;a href="http://youversion.com"&gt;Bible iPhone application&lt;/a&gt;. Turned 19.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;July:&lt;/strong&gt; No longer engaged. App Store released. Bible app launched.&lt;/p&gt;&lt;p&gt;This was the saddest time in my life. Hands down. In short, she changed her mind. Then, days later, the App Store launched to show off all of my work. It didn't even matter.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;October:&lt;/strong&gt; Joined a local band. Had a lot of fun with those guys.&lt;/p&gt;&lt;h4&gt;2009&lt;/h4&gt;&lt;p&gt;&lt;strong&gt;February:&lt;/strong&gt; Purchased a three bedroom house in Edmond, OK for $91,000.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;March:&lt;/strong&gt; Turned 20.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;April:&lt;/strong&gt; Launched a new version of &lt;a href="http://youversion.com"&gt;YouVersion.com&lt;/a&gt; while working at LifeChurch.tv. Put in my two weeks after the project was completed.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;May:&lt;/strong&gt; Started full time freelance for the first time. Worked &lt;a href="http://x3watch.com"&gt;X3watch&lt;/a&gt; for iOS and some PHP stuff for &lt;a href="http://pinchmedia.com"&gt;Pinch Media&lt;/a&gt; that never launched. I learned I hate big data in that project.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;June:&lt;/strong&gt; Attended WWDC for the first time. Met &lt;a href="http://twitter.com/rickchatham"&gt;Rick Chatham&lt;/a&gt;, founder of &lt;a href="http://tastefulworks.com"&gt;Tasteful Works&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;September:&lt;/strong&gt; Accepted an offer from Tasteful Works. Sold my beloved house and left my band. Moved to Dallas, TX.&lt;/p&gt;&lt;h4&gt;2010&lt;/h4&gt;&lt;p&gt;&lt;strong&gt;January:&lt;/strong&gt; Drove back to Oklahoma City play music with &lt;a href="http://twitter.com/mattgrimm"&gt;Matt Grimm&lt;/a&gt; and started what would be &lt;a href="http://findingchesterfield.com"&gt;Finding Chesterfield&lt;/a&gt;, our band.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;March:&lt;/strong&gt; Turned 21.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;May:&lt;/strong&gt; Recorded Finding Chesterfield's first EP with &lt;a href="http://twitter.com/kingofhangs"&gt;Luis Dubuc&lt;/a&gt; of &lt;a href="http://www.thesecrethandshake.net"&gt;The Secret Handshake&lt;/a&gt;. So fun.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;September:&lt;/strong&gt; Left Tasteful Works to freelance again. Started contracting full time for &lt;a href="http://rethinkbooks.com"&gt;RethinkBooks&lt;/a&gt;. I wrote the initial version of both the Rails and iOS apps. Some of that work was featured on &lt;a href="http://techcrunch.com/2010/11/11/rethink-books-social/"&gt;Tech Crunch&lt;/a&gt; and &lt;a href="http://bits.blogs.nytimes.com/2010/11/11/social-books-hopes-to-make-e-reading-communal/"&gt;The New York Times&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;October:&lt;/strong&gt; Released &lt;a href="http://findingchesterfield.com"&gt;A Three Day Walk EP&lt;/a&gt; (&lt;a href="http://itunes.apple.com/us/album/a-three-day-walk-ep/id396382460"&gt;iTunes Link&lt;/a&gt;).&lt;/p&gt;&lt;p&gt;&lt;strong&gt;December:&lt;/strong&gt; Moved from Dallas to San Francisco. Really sad to leave my friends and my band, but it was a great move professionally, so I did it.&lt;/p&gt;&lt;h4&gt;2011&lt;/h4&gt;&lt;p&gt;&lt;strong&gt;January:&lt;/strong&gt; Started working at &lt;a href="http://scribd.com"&gt;Scribd&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;March:&lt;/strong&gt; Turned 22.&lt;/p&gt;&lt;p&gt;That's it.&lt;/p&gt;&lt;h3&gt;Now What&lt;/h3&gt;&lt;p&gt;I ask myself "Now what?" a lot. I make more than 8 times what I was making when I left Kentucky. I live in one of the greatest cities in the world, but I still ask myself that a lot.&lt;/p&gt;&lt;p&gt;I feel like everything I've done these last four years are kinda worthless. The Bible App having more than 10 million users worldwide is pretty cool, but besides that, it was all just a job. Sure I have 4 years of work experience over anyone else my age, but who cares.&lt;/p&gt;&lt;p&gt;I think most of my outlook on life is effected by almost being married and then not being married. Realizing how great that is and then missing out really sucked. It's good it didn't end up happening, but still. &lt;em&gt;I just wonder how different life would have been had I just stayed in Kentucky and gone to college.&lt;/em&gt;&lt;/p&gt;&lt;h3&gt;Anyway&lt;/h3&gt;&lt;p&gt;I try to stay positive. I'm sure the next four years will have some awesome. I'll be 26. Crazy. Anyway, I thought I'd share.&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/85</id>
    <published>2011-05-11T01:00:33-05:00</published>
    <updated>2011-09-10T16:11:05-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/custom-cloud-app-viso" />
    <title>Custom Cloud App Viso</title>
    <content type="html">&lt;p&gt;If you haven't heard of &lt;a href="http://getcloudapp.com/"&gt;Cloud App&lt;/a&gt;, you must be living under a rock or something else that shields you from awesome. It's a fantastic service. You &lt;strong&gt;must&lt;/strong&gt; check it out.&lt;/p&gt;&lt;p&gt;Anyway, they've done some really cool stuff. The little app that servers your drops is written in &lt;a href="http://sinatrarb.com/"&gt;Sinatra&lt;/a&gt; and &lt;a href="https://github.com/cloudapp/viso"&gt;open-source on GitHub&lt;/a&gt;. &lt;em&gt;Awesome, right?!&lt;/em&gt; I forked and customized a bit.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://github.com/samsoffes/viso"&gt;Checkout my fork&lt;/a&gt;.&lt;/strong&gt; It's super simple, faster, and very HTML5-y. Before it included jQuery, some other Javascript, lots of CSS, etc. Now it's just one stylesheet and 2-3 images. I was proud.&lt;/p&gt;&lt;p&gt;Here's the &lt;a href="http://cl.ly/6eKj"&gt;original image slug&lt;/a&gt; and here's &lt;a href="http://soff.me/6eKj"&gt;my image slug&lt;/a&gt;. Here's the &lt;a href="http://cl.ly/6doW"&gt;original file slug&lt;/a&gt; and here's &lt;a href="http://soff.me/6doW"&gt;my file slug&lt;/a&gt;. I'm not totally happy with mine yet, but it's coming along.&lt;/p&gt;&lt;p&gt;I wrote  a &lt;a href="http://soff.me/21ek"&gt;custom video slug&lt;/a&gt;. It's really basic, but kinda cool. Definitely a big improvement over the &lt;a href="http://cl.ly/21ek"&gt;original video slug&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;I also plan on writing a sweet &lt;code&gt;&amp;lt;audio&amp;gt;&lt;/code&gt; player for audio drops. Maybe even use &lt;a href="http://scribd.com"&gt;Scribd&lt;/a&gt; embeds for PDF drops and some cool code coloring stuff for text drops that have color in them. Markdown drops would be cool too.&lt;/p&gt;&lt;p&gt;Anyway, it's pretty awesome that you can hack on it and build whatever you can imagine. I'm way excited to keep playing with it. If you need help getting it deployed, shoot them an email. They were really great.&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/84</id>
    <published>2011-04-28T23:53:50-05:00</published>
    <updated>2011-09-10T16:22:23-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/clean-up-your-project" />
    <title>Clean Up Your Project</title>
    <content type="html">&lt;p&gt;Many of the apps I work on are usually 100% custom. There is rarely any system UI components visible to the user. Styling the crap out of apps like this makes for tons of images in my iOS projects to get everything the way the designer wants. I'm starting to &lt;code&gt;drawRect:&lt;/code&gt; stuff more these days because it makes it easier to reuse, but anyway.&lt;/p&gt;&lt;p&gt;There are literally hundreds of images in the &lt;a href="http://samsoff.es/posts/im-moving-to-san-francisco"&gt;Scribd&lt;/a&gt; app I've been working on. Designers changing their mind plus everything custom leaves a lot of images behind that are no longer used. Our application was starting to be several megs and a lot of it was unused images. So... being the programmer I am, &lt;em&gt;I wrote a script&lt;/em&gt;.&lt;/p&gt;&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="n"&gt;desc&lt;/span&gt; &lt;span class="s1"&gt;'Remove unused images'&lt;/span&gt;
&lt;span class="n"&gt;task&lt;/span&gt; &lt;span class="ss"&gt;:clean_assets&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt;
  &lt;span class="nb"&gt;require&lt;/span&gt; &lt;span class="s1"&gt;'set'&lt;/span&gt;

  &lt;span class="n"&gt;all&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Set&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;
  &lt;span class="n"&gt;used&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Set&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;
  &lt;span class="n"&gt;unused&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Set&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;

  &lt;span class="c1"&gt;# White list&lt;/span&gt;
  &lt;span class="n"&gt;used&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;merge&lt;/span&gt; &lt;span class="sx"&gt;%w{Icon Icon-29 Icon-50 Icon-58 Icon-72 Icon-114}&lt;/span&gt;

  &lt;span class="n"&gt;regex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sr"&gt;/\[UIImage imageNamed:@"([a-zA-Z0-9\-_]+).png"\]/&lt;/span&gt;
  &lt;span class="no"&gt;Dir&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;glob&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Classes/*.m'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
    &lt;span class="n"&gt;used&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;merge&lt;/span&gt; &lt;span class="no"&gt;File&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;scan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;regex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;flatten&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="no"&gt;Dir&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;glob&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Resources/Images/*.png'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
    &lt;span class="k"&gt;next&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;include?&lt;/span&gt; &lt;span class="s1"&gt;'@2x.png'&lt;/span&gt;
    &lt;span class="n"&gt;all&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;gsub&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/Resources\/Images\/([a-zA-Z0-9\-_]+).png/&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;1"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="n"&gt;unused&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;all&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;used&lt;/span&gt;
  &lt;span class="n"&gt;unused&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;each&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;
    &lt;span class="sb"&gt;`rm -f Resources/Images/&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sb"&gt;.png Resources/Images/&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sb"&gt;@2x.png`&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;all&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; total found"&lt;/span&gt;
  &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;used&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; used found"&lt;/span&gt;
  &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;unused&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; deleted"&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It basically searches all of your source files for references for &lt;code&gt;[UIImage imageWithName:@"image_name_here"]&lt;/code&gt;. Then it looks at all of the images on disk and removes any you didn't reference. I setup a whitelist for icons and other images I don't reference directly. You might need to tweak the paths a bit to work for your setup.&lt;/p&gt;&lt;p&gt;Hopefully this little &lt;a href="http://railscasts.com/episodes/66-custom-rake-tasks"&gt;rake task&lt;/a&gt; helps someone clean up their project too.&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/83</id>
    <published>2011-03-04T00:03:21-06:00</published>
    <updated>2011-09-10T16:11:05-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/typical-sam" />
    <title>Typical Sam</title>
    <content type="html">&lt;p&gt;National Geographic released &lt;a href="http://news.yahoo.com/s/yblog_thelookout/20110303/us_yblog_thelookout/the-most-typical-face-on-the-planet"&gt;a video about the typical human&lt;/a&gt;. It's really interesting. You should watch it.&lt;/p&gt;&lt;p&gt;I was curious how typical I am. Here's the typical traits and how I line up:&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Right handed:&lt;/strong&gt; &lt;em&gt;Yep&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Makes less than $12,000 a year:&lt;/strong&gt; Nope&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Owns a cell phone:&lt;/strong&gt; &lt;em&gt;Yep&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Doesn't have a bank account:&lt;/strong&gt; Nope&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Male:&lt;/strong&gt; &lt;em&gt;Yep&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;28 years old:&lt;/strong&gt; Nope&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Chinese:&lt;/strong&gt; Nope&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So I answered &lt;em&gt;Yep&lt;/em&gt; to 42% of the traits. I guess that means I'm about the typical amount of not typical. (Ya, read that again. I felt clever writing it.) So, cool. That was fun.&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/82</id>
    <published>2011-02-23T05:26:45-06:00</published>
    <updated>2011-09-10T16:23:15-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/how-to-drastically-improve-your-app-with-an-afternoon-and-instruments" />
    <title>How to Drastically Improve Your App with an Afternoon and Instruments</title>
    <content type="html">&lt;p&gt;I was &lt;a href="http://twitter.com/#!/samsoffes/status/40214844405710848"&gt;bragging on Twitter&lt;/a&gt; about how I just made my application way better with some simple tweaks. I wanted to write a quick post about what I did that really helped that will probably help most people. This stuff is a bit application specific, but I think you'll see parallels to your application.&lt;/p&gt;&lt;h3&gt;Symptoms&lt;/h3&gt;&lt;p&gt;My application pulls a ton of data from the network and puts it in Core Data when you login for the first time. From using the application, I noticed that performance totally sucks at first and then goes back to normal. (My table views all scroll at 60fps, but I'll save that for another post. Sorry. Had to throw that in there. I'm way proud.) This was troubling since it usually works really great, (okay, now I'm done bragging about my cells) so I investigated.&lt;/p&gt;&lt;p&gt;Just so you know, I am doing all of my networking, data parsing, and insertion into Core Data on background threads via &lt;code&gt;NSOperationQueue&lt;/code&gt;.&lt;/p&gt;&lt;h3&gt;The Problems&lt;/h3&gt;&lt;p&gt;After running Instruments with the object allocations instrument, I noticed that I was using about 22MB of memory while it was downloading all of this data. In my opinion, that is way too high. I'll add that to list of stuff to mess with.&lt;/p&gt;&lt;p&gt;I also noticed that my &lt;code&gt;NSDate&lt;/code&gt; category for parsing &lt;a href="http://en.wikipedia.org/wiki/ISO_8601"&gt;ISO8601&lt;/a&gt; date strings (standard way to put a date into &lt;a href="http://en.wikipedia.org/wiki/JSON"&gt;JSON&lt;/a&gt;) was taking about 7.4 seconds using the timer instrument. Totally unacceptable. Added to the list.&lt;/p&gt;&lt;p&gt;After messing around for a little while longer, I noticed that a lot of time was being spent in one of my &lt;code&gt;NSString&lt;/code&gt; categories, specifically in &lt;code&gt;NSRegularExpression&lt;/code&gt;. This sounds annoying, so I'll save that for last.&lt;/p&gt;&lt;h3&gt;The Solutions&lt;/h3&gt;&lt;h4&gt;Memory&lt;/h4&gt;&lt;p&gt;I had a few guess on how to cut memory usage while converting large amounts of JSON strings into &lt;code&gt;NSManagedObject&lt;/code&gt;s. My guess was that a ton of objects needed to be autoreleased but the &lt;code&gt;NSAutoreleasePool&lt;/code&gt; wasn't being drained until the operation finished. The simple solution for this to &lt;em&gt;add a well-placed &lt;code&gt;NSAutoreleasePool&lt;/code&gt; around problem code&lt;/em&gt;. This took a few tries to get in the right spot. I would put it where I think most of the temporary objects were being created and then watch the object allocations instrument to make sure it got flatter.&lt;/p&gt;&lt;p&gt;Here was my first try:&lt;/p&gt;&lt;p&gt;&lt;img src="http://assets.samsoff.es/posts/how-to-drastically-improve-your-app-with-an-afternoon-and-instruments/try-1.png" alt="First Try"&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;See how it goes up and drops sharply down a bit and then builds up for awhile then finally drops off? That's a sign there is another loop nested deeper down that should have a pool around it. For the first one, it did a little and then drained (probably because it did less stuff in that operation). Since the second giant hump (note the peak of that is 23MB or so) doesn't drop off for awhile, I know to look for another loop deeper down. Hopefully that makes sense. Once you get in there, it will suddenly hit you after stumbling around for a bit. You'll see.&lt;/p&gt;&lt;p&gt;After moving it to a more nested loop, here's the result:&lt;/p&gt;&lt;p&gt;&lt;img src="http://assets.samsoff.es/posts/how-to-drastically-improve-your-app-with-an-afternoon-and-instruments/try-2.png" alt="Second Try"&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;Once I got it in the right spot, &lt;em&gt;it was using under 2MB of memory for the entire process!&lt;/em&gt; Score! Next problem.&lt;/p&gt;&lt;h4&gt;Date Stuff&lt;/h4&gt;&lt;p&gt;The date stuff had me stumped for awhile. I was using &lt;a href="https://github.com/square/iso8601parser"&gt;ISO8601Parser&lt;/a&gt; (a subclass of &lt;code&gt;NSFormatter&lt;/code&gt;) which was working really, really well compared to &lt;code&gt;NSDateFormatter&lt;/code&gt;. After looking at timer instrument, I saw that most of that time was spent in system classes like &lt;code&gt;NSCFCalendar&lt;/code&gt;. I assumed there was a better way. I tried switched back to &lt;code&gt;NSDateFormatter&lt;/code&gt;, but that didn't work well and still wasn't great memory and speed wise.&lt;/p&gt;&lt;p&gt;As a disclaimer, I am all about Objective-C. I love it. I'm not one of those engineers that's says "hey, we should rewrite this in C" all the time, but hey, we should rewrite this in C. I did... and the result was astounding!&lt;/p&gt;&lt;p&gt;Here's the code:&lt;/p&gt;&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="cp"&gt;#include &amp;lt;time.h&amp;gt;&lt;/span&gt;

&lt;span class="k"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;NSDate&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;dateFromISO8601String:&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;NSString&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nv"&gt;string&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;tm&lt;/span&gt; &lt;span class="n"&gt;tm&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;time_t&lt;/span&gt; &lt;span class="n"&gt;t&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;    

    &lt;span class="n"&gt;strptime&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;string&lt;/span&gt; &lt;span class="nl"&gt;cStringUsingEncoding:&lt;/span&gt;&lt;span class="n"&gt;NSUTF8StringEncoding&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="s"&gt;"%Y-%m-%dT%H:%M:%S%z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;tm&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;tm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tm_isdst&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;mktime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;tm&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;NSDate&lt;/span&gt; &lt;span class="nl"&gt;dateWithTimeIntervalSince1970:&lt;/span&gt;&lt;span class="n"&gt;t&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="n"&gt;NSTimeZone&lt;/span&gt; &lt;span class="n"&gt;localTimeZone&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;secondsFromGMT&lt;/span&gt;&lt;span class="p"&gt;]];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;


&lt;span class="k"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;NSString&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;ISO8601String&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="n"&gt;tm&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;timeinfo&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

    &lt;span class="n"&gt;time_t&lt;/span&gt; &lt;span class="n"&gt;rawtime&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt; &lt;span class="n"&gt;timeIntervalSince1970&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="n"&gt;NSTimeZone&lt;/span&gt; &lt;span class="n"&gt;localTimeZone&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;secondsFromGMT&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="n"&gt;timeinfo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;localtime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;rawtime&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;strftime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"%Y-%m-%dT%H:%M:%S%z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;timeinfo&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;NSString&lt;/span&gt; &lt;span class="nl"&gt;stringWithCString:&lt;/span&gt;&lt;span class="n"&gt;buffer&lt;/span&gt; &lt;span class="nl"&gt;encoding:&lt;/span&gt;&lt;span class="n"&gt;NSUTF8StringEncoding&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;See, it's not too crazy. &lt;em&gt;Using the C date stuff took my date parsing from 7.4 seconds to 300ms. Talk about a performance boost!&lt;/em&gt; (I updated &lt;a href="http://github.com/samsoffes/sstoolkit"&gt;SSTookit&lt;/a&gt;'s &lt;a href="https://github.com/samsoffes/sstoolkit/blob/master/SSToolkit/NSDate%2BSSToolkitAdditions.h"&gt;NSDate category&lt;/a&gt; to use this new code.)&lt;/p&gt;&lt;h4&gt;Regular Expression&lt;/h4&gt;&lt;p&gt;I have several &lt;code&gt;NSString&lt;/code&gt; categories in my application for doing various things. Some of them were called throughout the process I was trying to optimize. I drilled down in the time profiler instrument and realized that &lt;code&gt;[NSRegularExpression regularExpressionWith...]&lt;/code&gt; was taking a ton of the time. This totally makes sense, since it compiles your regex to use later and I was doing it each time. Simple solution:&lt;/p&gt;&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="k"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;NSString&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="nf"&gt;camelCaseString&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="n"&gt;NSRegularExpression&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;regex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;regex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;regex&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="n"&gt;NSRegularExpression&lt;/span&gt; &lt;span class="n"&gt;alloc&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="nl"&gt;initWithPattern:&lt;/span&gt;&lt;span class="s"&gt;@"(?:_)(.)"&lt;/span&gt; &lt;span class="nl"&gt;options:&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="nl"&gt;error:&lt;/span&gt;&lt;span class="nb"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;// Use regex...&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This was actually the easiest part :)&lt;/p&gt;&lt;h3&gt;Conclusions&lt;/h3&gt;&lt;p&gt;So using Instruments to track down slow or bad code is really easy once you get the hang of it. Start with the leaks instrument if you're new. You shouldn't have any (known) leaks in your application.&lt;/p&gt;&lt;p&gt;Once you get that down (or get so frustrated trying to track it down you give up and move to something else) do the object allocations instrument next. You can watch the graph and see how many objects you have alive. If you see a big spike that never goes down, you most likely have a ton of memory around that you probably don't need but still have a reference to so it doesn't show up in leaks. Adding autorelease pools around loops that do lots of processing always helps.&lt;/p&gt;&lt;p&gt;Finally, use the time profiler instrument to see what's taking a long time and optimize the crap out of it. This is the most fun since it's easy to see whats happening and how much of an improvement you made by the changes you just made. The key to making this instrument useful is the checkboxes on the left. Turning on Objective-C only or toggling the inverted stack tree is really useful.&lt;/p&gt;&lt;h3&gt;This is Hard&lt;/h3&gt;&lt;p&gt;Don't feel bad, especially if you're new to this. This stuff is hard. All of my solutions I listed above are pretty simple. I spent almost an entire day coming up with those few things. The majority of the time you spend will be tracking down problems. Fixing them is usually pretty simple, especially after you've done it a few times. This is hard. You're smart. :)&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/81</id>
    <published>2011-02-16T23:09:47-06:00</published>
    <updated>2011-09-10T16:11:05-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/52-profiles-video" />
    <title>52 Profiles Video</title>
    <content type="html">&lt;p&gt;I recently shot a video of my good friend, &lt;a href="http://kylesteed.com"&gt;Kyle Steed&lt;/a&gt;, and his &lt;a href="http://52profiles.com"&gt;52 Profiles&lt;/a&gt; project before I moved from Texas. It's a really neat project he's been doing the last year where he draws a different person's profile ever week.&lt;/p&gt;&lt;div class="video vimeo wide"&gt;&lt;iframe src="http://player.vimeo.com/video/20028824?title=0&amp;amp;byline=0&amp;amp;portrait=0&amp;amp;color=f05b35" width="640" height="360" frameborder="0"&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;p&gt;Leave a comment &lt;a href="http://vimeo.com/20028824"&gt;on vimeo&lt;/a&gt; and let me know what you think. &lt;a href="http://twitter.com/kylesteed"&gt;Follow Kyle on Twitter&lt;/a&gt; while you're at it.&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
  <entry>
    <id>tag:samsoff.es,2005:Post/80</id>
    <published>2011-01-31T10:59:22-06:00</published>
    <updated>2011-09-10T16:11:05-05:00</updated>
    <link rel="alternate" type="text/html" href="http://samsoff.es/posts/some-sstoolkit-additions" />
    <title>Some SSToolkit Additions</title>
    <content type="html">&lt;p&gt;Over the weekend, I messed around and added some stuff to &lt;a href="http://sstoolk.it"&gt;SSToolkit&lt;/a&gt;. The most useable thing I added was a simple badge view and cell that wraps it for shows simple badges like Mail.app in iOS. Here's a screenshot:&lt;/p&gt;&lt;p&gt;&lt;a href="http://sstoolk.it"&gt;&lt;img src="http://assets.samsoff.es/posts/some-sstoolkit-additions/badgeview.png" alt="SSToolkit"&gt;&lt;br&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Hopefully someone will find that useful. I also switched to LLVM 1.6 and increased the warning level to be more strict. Lately I've been a big fan of stricter warnings. I feel like I'm writing better code when it makes me check types, etc.&lt;/p&gt;&lt;p&gt;My buddy, &lt;a href="http://twitter.com/hectorramos"&gt;@hectorramos&lt;/a&gt; helped me document the class and fixed a few bugs in &lt;a href="https://github.com/samsoffes/sstoolkit/blob/master/SSToolkit/SSSwitch.h"&gt;SSSwitch&lt;/a&gt;. It still needs documentation if you want to help :)&lt;/p&gt;</content>
    <author>
      <name>Sam Soffes</name>
    </author>
  </entry>
</feed>

