<?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> &#187; Lee</title>
	<atom:link href="http://blog.blazingcloud.net/author/macboypro/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.blazingcloud.net</link>
	<description></description>
	<lastBuildDate>Tue, 04 Jun 2013 18:20:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
		<item>
		<title>OpenLaszlo Syntax Highlighting for MacVim/Vim</title>
		<link>http://blog.blazingcloud.net/2011/12/28/openlaszlo-syntax-highlighting-for-macvimvim/</link>
		<comments>http://blog.blazingcloud.net/2011/12/28/openlaszlo-syntax-highlighting-for-macvimvim/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 00:39:18 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[OpenLaszlo]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blazingcloud.net/?p=2731</guid>
		<description><![CDATA[The OpenLaszlo documentation isn&#8217;t specific about how to install syntax highlighting for vim on mac. So we thought we would write up a little blurb about how to do it! Copy the lzx.vim syntax file to dot vim directory in your home directory cp openlaszlo/trunk/tools/lzx.vim ~/.vim/syntax/ Create a file called .vimrc.local for your custom vim [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>The OpenLaszlo documentation isn&#8217;t specific about how to install syntax highlighting for vim on mac. So we thought we would write up a little blurb about how to do it!</p>
<p>Copy the <a href="http://svn.openlaszlo.org/openlaszlo/trunk/tools/lzx.vim">lzx.vim syntax file</a> to dot vim directory in your home directory<br />
<code>cp openlaszlo/trunk/tools/lzx.vim ~/.vim/syntax/</code></p>
<p>Create a file called .vimrc.local for your custom vim modifications also in your home directory<br />
<code>mvim ~/.vimrc.local</code></p>
<p>Finally, add an autocommand that will auto detect the file type<br />
<code>au BufRead,BufNewFile *.lzx set ft=lzx</code></p>
<p>Reference:<br />
For more information about vim file types you might want to check out <a href="http://vimdoc.sourceforge.net/htmldoc/filetype.html">http://vimdoc.sourceforge.net/htmldoc/filetype.html</a></p>
<p>OpenLaszlo documentation on how to install Vim Syntax highlighting on linux based systems<br />
<a href="http://wiki.openlaszlo.org/Editing_LZX#Installing_VIM_Syntax_Highlighting">http://wiki.openlaszlo.org/Editing_LZX#Installing_VIM_Syntax_Highlighting</a></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.blazingcloud.net/2011/12/28/openlaszlo-syntax-highlighting-for-macvimvim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Devise Authentication in Rails 3 (Updated for devise 2)</title>
		<link>http://blog.blazingcloud.net/2011/01/08/devise-authentication-in-rails-3/</link>
		<comments>http://blog.blazingcloud.net/2011/01/08/devise-authentication-in-rails-3/#comments</comments>
		<pubDate>Sat, 08 Jan 2011 20:23:05 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[Devise]]></category>
		<category><![CDATA[Rails3]]></category>

		<guid isPermaLink="false">http://blazingcloud.net/?p=2088</guid>
		<description><![CDATA[Devise Github project page: https://github.com/plataformatec/devise After some google searching I arrived at the decision to use Devise over Authlogic for my brand spanking new rails 3 app. I haven&#8217;t really had that much experience with authlogic in the past, besides using it in my previous rails 3 app. It was a little tricky to get it [...]]]></description>
			<content:encoded><![CDATA[<p>Devise Github project page: <a href="https://github.com/plataformatec/devise">https://github.com/plataformatec/devise</a></p>
<p>After some google searching I arrived at the decision to use Devise over Authlogic for my brand spanking new rails 3 app. I haven&#8217;t really had that much experience with authlogic in the past, besides using it in my previous rails 3 app. It was a little tricky to get it working with rails 3 and I wasn&#8217;t the biggest fan of the documentation (I felt it could have been a little more granular). That being said I have never used Devise but the yammering on the internet suggests it is a cleaner solution and works out of the box with rails 3. (<a href="http://stackoverflow.com/questions/4136121/rails-3-authentication-authlogic-vs-devise">http://stackoverflow.com/questions/4136121/rails-3-authentication-authlogic-vs-devise</a>) I also liked some of the out of the box features it came with:</p>
<ul>
<li>Database Authenticatable: encrypts and stores a password in the database to validate the authenticity of an user while signing in. The authentication can be done both through POST requests or HTTP Basic Authentication.</li>
<li>Token Authenticatable: signs in a user based on an authentication token (also known as &#8220;single access token&#8221;). The token can be given both through query string or HTTP Basic Authentication.</li>
<li>Confirmable: sends emails with confirmation instructions and verifies whether an account is already confirmed during sign in.</li>
<li>Recoverable: resets the user password and sends reset instructions.</li>
<li>Registerable: handles signing up users through a registration process, also allowing them to edit and destroy their account.</li>
<li>Rememberable: manages generating and clearing a token for remembering the user from a saved cookie.</li>
<li>Trackable: tracks sign in count, timestamps and IP address.</li>
<li>Timeoutable: expires sessions that have no activity in a specified period of time.</li>
<li>Validatable: provides validations of email and password. It’s optional and can be customized, so you’re able to define your own validations.</li>
<li>Lockable: locks an account after a specified number of failed sign-in attempts. Can unlock via email or after a specified time period.</li>
<li>Encryptable: adds support of other authentication mechanisms besides the built-in Bcrypt (the default).</li>
</ul>
<h2>The Exploration</h2>
<p>First things first, add &#8220;devise&#8221; to your rails Gemfile in the root directory of your application.<br />
<span style="font-weight: bold;">Note: this example assumes knowledge of the bundler gem</span></p><pre class="crayon-plain-tag">bundle install</pre><p>Running <em>bundle install</em> will set you up with:</p><pre class="crayon-plain-tag">Installing bcrypt-ruby (3.0.1) with native extensions
Installing warden (1.1.1)
Installing devise (2.0.4)</pre><p>Following the install docs on the Devise project page..</p><pre class="crayon-plain-tag">rails generate devise:install
      create  config/initializers/devise.rb
      create  config/locales/devise.en.yml

===============================================================================

Some setup you must do manually if you haven't yet:

  1. Setup default url options for your specific environment. Here is an
     example of development environment:

       config.action_mailer.default_url_options = { :host =&amp;gt; 'localhost:3000' }

     This is a required Rails configuration. In production it must be the
     actual host of your application

  2. Ensure you have defined root_url to *something* in your config/routes.rb.
     For example:

       root :to =&amp;gt; &quot;home#index&quot;

  3. Ensure you have flash messages in app/views/layouts/application.html.erb.
     For example:

       &amp;lt;p class=&quot;notice&quot;&amp;gt;&amp;lt;%= notice %&amp;gt;&amp;lt;/p&amp;gt;
       &amp;lt;p class=&quot;alert&quot;&amp;gt;&amp;lt;%= alert %&amp;gt;&amp;lt;/p&amp;gt;

===============================================================================</pre><p>Alright, based on the install output it looks like we need to do a little setup work&#8230; However, I will leave that to the reader since they may be using a pre-existing rails application&#8230;</p>
<p>After you are finished configuring the application its time to create your user model.</p><pre class="crayon-plain-tag">rails generate devise User
      invoke  active_record
      create    app/models/user.rb
      invoke    test_unit
      create      test/unit/user_test.rb
      create      test/fixtures/users.yml
      create    db/migrate/20110108192129_devise_create_users.rb
      insert    app/models/user.rb
       route  devise_for :users</pre><p>Great, lets take a look at what the generator created starting with the migration.</p><pre class="crayon-plain-tag">class DeviseCreateUsers &amp;lt; ActiveRecord::Migration
 def change
  create_table(:users) do |t|
   ## Database authenticatable
   t.string :email, :null =&amp;gt; false, :default =&amp;gt; &quot;&quot;
   t.string :encrypted_password, :null =&amp;gt; false, :default =&amp;gt; &quot;&quot;

   ## Recoverable
   t.string :reset_password_token
   t.datetime :reset_password_sent_at

   ## Rememberable
   t.datetime :remember_created_at

   ## Trackable
   t.integer :sign_in_count, :default =&amp;gt; 0
   t.datetime :current_sign_in_at
   t.datetime :last_sign_in_at
   t.string :current_sign_in_ip
   t.string :last_sign_in_ip

   ## Encryptable
   # t.string :password_salt

   ## Confirmable
   t.string :confirmation_token
   t.datetime :confirmed_at
   t.datetime :confirmation_sent_at
   t.string :unconfirmed_email # Only if using reconfirmable

   ## Lockable
   t.integer :failed_attempts, :default =&amp;gt; 0 # Only if lock strategy is :failed_attempts
   t.string :unlock_token # Only if unlock strategy is :email or :both
   t.datetime :locked_at

   ## Token authenticatable
   # t.string :authentication_token

   t.timestamps
  end

  add_index :users, :email, :unique =&amp;gt; true
  add_index :users, :reset_password_token, :unique =&amp;gt; true
  # add_index :users, :confirmation_token, :unique =&amp;gt; true
  # add_index :users, :unlock_token, :unique =&amp;gt; true
  # add_index :users, :authentication_token, :unique =&amp;gt; true
 end
end</pre><p>It looks like Devise gives you password encryption/storing, password recovery, session tokens, and login attempts by default. For my application I will also uncomment the lines for <em>Confirmable</em>,<em> Lockable</em> and <em>Token authenticatable</em> since I find these registration options useful out of the box and will save me time from writing those components later.</p>
<p>The only thing I needed to investigate of these options was the <em>Lockable</em> option since I wanted to understand the lock and unlock strategies.</p><pre class="crayon-plain-tag">:unlock_strategy - The strategy used for unlock. Can be :time, :email, :both (default), :none.
If :email or :both, creates a unlock_token field.</pre><p></p><pre class="crayon-plain-tag">:lock_strategy - The strategy used for locking. Can be :failed_attempts (default) or :none.</pre><p>Alright, now that we understand what they mean here is what my final migration looks like:</p><pre class="crayon-plain-tag">class DeviseCreateUsers &amp;lt; ActiveRecord::Migration
 def change
  create_table(:users) do |t|
   ## Database authenticatable
   t.string :email, :null =&amp;gt; false, :default =&amp;gt; &quot;&quot;
   t.string :encrypted_password, :null =&amp;gt; false, :default =&amp;gt; &quot;&quot;

   ## Recoverable
   t.string :reset_password_token
   t.datetime :reset_password_sent_at

   ## Rememberable
   t.datetime :remember_created_at

   ## Trackable
   t.integer :sign_in_count, :default =&amp;gt; 0
   t.datetime :current_sign_in_at
   t.datetime :last_sign_in_at
   t.string :current_sign_in_ip
   t.string :last_sign_in_ip

   ## Encryptable
   # t.string :password_salt

   ## Confirmable
   t.string :confirmation_token
   t.datetime :confirmed_at
   t.datetime :confirmation_sent_at
   t.string :unconfirmed_email # Only if using reconfirmable

   ## Lockable
   t.integer :failed_attempts, :default =&amp;gt; 0 # Only if lock strategy is :failed_attempts
   t.string :unlock_token # Only if unlock strategy is :email or :both
   t.datetime :locked_at

   ## Token authenticatable
   t.string :authentication_token

   t.timestamps
  end

  add_index :users, :email, :unique =&amp;gt; true
  add_index :users, :reset_password_token, :unique =&amp;gt; true
  add_index :users, :confirmation_token, :unique =&amp;gt; true
  add_index :users, :unlock_token, :unique =&amp;gt; true
  add_index :users, :authentication_token, :unique =&amp;gt; true
 end
end</pre><p>Now let&#8217;s take a look at our User model.</p><pre class="crayon-plain-tag">class User &amp;lt; ActiveRecord::Base
  # Include default devise modules. Others available are:
  # :token_authenticatable, :confirmable, :lockable and :timeoutable
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable
  # Setup accessible (or protected) attributes for your model
  attr_accessible :email, :password, :password_confirmation, :remember_me
end</pre><p>It looks like based on our migration options that we will also have to uncomment <em>token_authenticatable, :confirmable, :lockable and :timeoutable</em> and add it to the devise option.</p><pre class="crayon-plain-tag">class User &amp;lt; ActiveRecord::Base
  # Include default devise modules. Others available are:
  devise :database_authenticatable, :registerable,
         :recoverable, :rememberable, :trackable, :validatable,
         :token_authenticatable, :confirmable, :lockable, :timeoutable

  # Setup accessible (or protected) attributes for your model
  attr_accessible :email, :password, :password_confirmation, :remember_me
end</pre><p>We don&#8217;t need to setup our routes for user because devise has already added <em>devise_for :users</em> to our config/routes.rb for us. If we then run <em>rake routes</em> from the command line we get:</p><pre class="crayon-plain-tag">      new_user_session GET    /users/sign_in(.:format)          {:action=&amp;gt;&quot;new&quot;, :controller=&amp;gt;&quot;devise/sessions&quot;}
          user_session POST   /users/sign_in(.:format)          {:action=&amp;gt;&quot;create&quot;, :controller=&amp;gt;&quot;devise/sessions&quot;}
  destroy_user_session GET    /users/sign_out(.:format)         {:action=&amp;gt;&quot;destroy&quot;, :controller=&amp;gt;&quot;devise/sessions&quot;}
         user_password POST   /users/password(.:format)         {:action=&amp;gt;&quot;create&quot;, :controller=&amp;gt;&quot;devise/passwords&quot;}
     new_user_password GET    /users/password/new(.:format)     {:action=&amp;gt;&quot;new&quot;, :controller=&amp;gt;&quot;devise/passwords&quot;}
    edit_user_password GET    /users/password/edit(.:format)    {:action=&amp;gt;&quot;edit&quot;, :controller=&amp;gt;&quot;devise/passwords&quot;}
         user_password PUT    /users/password(.:format)         {:action=&amp;gt;&quot;update&quot;, :controller=&amp;gt;&quot;devise/passwords&quot;}
     user_registration POST   /users(.:format)                  {:action=&amp;gt;&quot;create&quot;, :controller=&amp;gt;&quot;devise/registrations&quot;}
 new_user_registration GET    /users/sign_up(.:format)          {:action=&amp;gt;&quot;new&quot;, :controller=&amp;gt;&quot;devise/registrations&quot;}
edit_user_registration GET    /users/edit(.:format)             {:action=&amp;gt;&quot;edit&quot;, :controller=&amp;gt;&quot;devise/registrations&quot;}
     user_registration PUT    /users(.:format)                  {:action=&amp;gt;&quot;update&quot;, :controller=&amp;gt;&quot;devise/registrations&quot;}
     user_registration DELETE /users(.:format)                  {:action=&amp;gt;&quot;destroy&quot;, :controller=&amp;gt;&quot;devise/registrations&quot;}
     user_confirmation POST   /users/confirmation(.:format)     {:action=&amp;gt;&quot;create&quot;, :controller=&amp;gt;&quot;devise/confirmations&quot;}
 new_user_confirmation GET    /users/confirmation/new(.:format) {:action=&amp;gt;&quot;new&quot;, :controller=&amp;gt;&quot;devise/confirmations&quot;}
     user_confirmation GET    /users/confirmation(.:format)     {:action=&amp;gt;&quot;show&quot;, :controller=&amp;gt;&quot;devise/confirmations&quot;}
           user_unlock POST   /users/unlock(.:format)           {:action=&amp;gt;&quot;create&quot;, :controller=&amp;gt;&quot;devise/unlocks&quot;}
       new_user_unlock GET    /users/unlock/new(.:format)       {:action=&amp;gt;&quot;new&quot;, :controller=&amp;gt;&quot;devise/unlocks&quot;}
           user_unlock GET    /users/unlock(.:format)           {:action=&amp;gt;&quot;show&quot;, :controller=&amp;gt;&quot;devise/unlocks&quot;}
                  root        /(.:format)                       {:controller=&amp;gt;&quot;home&quot;, :action=&amp;gt;&quot;index&quot;}</pre><p>Finally it&#8217;s time to migrate our database and create our user model.</p><pre class="crayon-plain-tag">rake db:migrate</pre><p></p><pre class="crayon-plain-tag">==  DeviseCreateUsers: migrating ==============================================
-- create_table(:users)
NOTICE:  CREATE TABLE will create implicit sequence &quot;users_id_seq&quot; for serial column &quot;users.id&quot;
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index &quot;users_pkey&quot; for table &quot;users&quot;
   -&amp;gt; 0.0553s
-- add_index(:users, :email, {:unique=&amp;gt;true})
   -&amp;gt; 0.0020s
-- add_index(:users, :reset_password_token, {:unique=&amp;gt;true})
   -&amp;gt; 0.0021s
-- add_index(:users, :confirmation_token, {:unique=&amp;gt;true})
   -&amp;gt; 0.0115s
-- add_index(:users, :unlock_token, {:unique=&amp;gt;true})
   -&amp;gt; 0.0028s
==  DeviseCreateUsers: migrated (0.0740s) =====================================</pre><p>Now it&#8217;s time to start our rails server and see what devise has given us. Run <em>rails server</em> from the command line and lets travel to &#8220;localhost:3000/users/sign_up&#8221; and see whats going on.</p>
<p><img src="https://img.skitch.com/20110108-tt6kt9mc22rm67jnstbesg46qr.jpg" alt="Trackr" /></p>
<p>My first thoughts are &#8220;Wow, that&#8217;s kind of ugly&#8221;. haha. Looks like down the line I will have to override those views and build custom ones (by overriding the routes!). I then attempt to sign up by filling out the form. The page reloads and tells me &#8220;You have signed up successfully. If enabled, a confirmation was sent to your e-mail.&#8221;. Yay, alright now I realize immediatly that I haven&#8217;t yet setup an smtp server on my local machine however if we check the server output or logs we will see a generated message:</p><pre class="crayon-plain-tag">Sent mail to lee@blazingcloud.net (58ms)
Date: Sat, 08 Jan 2011 12:04:04 -0800
From: please-change-me@config-initializers-devise.com
To: lee@blazingcloud.net
Message-ID: &amp;lt;4d28c334b84a5_7cb680e634b492756@Atum.local.mail&amp;gt;
Subject: Confirmation instructions
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit
&amp;lt;p&amp;gt;Welcome lee@blazingcloud.net!&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;You can confirm your account through the link below:&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;a href=&quot;http://localhost:3000/users/confirmation?confirmation_token=wYQlv1D1lbB9InFq8dVZ&quot;&amp;gt;Confirm my account&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;
Sent mail to lee@blazingcloud.net (58ms)Date: Sat, 08 Jan 2011 12:04:04 -0800From: please-change-me@config-initializers-devise.comTo: lee@blazingcloud.netMessage-ID: &amp;lt;4d28c334b84a5_7cb680e634b492756@Atum.local.mail&amp;gt;Subject: Confirmation instructionsMime-Version: 1.0Content-Type: text/html;&nbsp;charset=UTF-8Content-Transfer-Encoding: 7bit
&amp;lt;p&amp;gt;Welcome lee@blazingcloud.net!&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;You can confirm your account through the link below:&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;a href=&quot;http://localhost:3000/users/confirmation?confirmation_token=wYQlv1D1lbB9InFq8dVZ&quot;&amp;gt;Confirm my account&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;</pre><p>Fantastic if we go to the confirmation address <em>http://localhost:3000/users/confirmation?confirmation_token=wYQlv1D1lbB9InFq8dVZ</em> we should be able to active our new account and sure enough the confirm works and sends us to the homepage with the message &#8216;Your account was successfully confirmed. You are now signed in.&#8217;</p>
<h2>Conclusion</h2>
<p>Devise is easy to setup and install using Rails 3. It give me the flexibility and features I need to fulfill the authentication requirements of my application. Good documentation and setup instructions go a long way. We will see with time if I regret my decision. If anyone out there in the internets know of any helpful information that would be beneficial to this blog post please comment below!</p>
<h2>Update</h2>
<p>To update your Devise views run this from the command line:</p><pre class="crayon-plain-tag">rails generate devise:views</pre><p>This will pull the views from the gem and allow you to modify them.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blazingcloud.net/2011/01/08/devise-authentication-in-rails-3/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>BieberFy</title>
		<link>http://blog.blazingcloud.net/2010/09/23/bieberfy/</link>
		<comments>http://blog.blazingcloud.net/2010/09/23/bieberfy/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 22:12:10 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Products]]></category>
		<category><![CDATA[BieberFy]]></category>
		<category><![CDATA[iPod]]></category>

		<guid isPermaLink="false">http://blazingcloud.net/?p=1291</guid>
		<description><![CDATA[Here at Blazing Cloud we are happy to announce the launch of our first official product, BieberFy! BieberFy was inspired by Justin Bieber and the overwhelming response to his floppy teenage hair cut. So we thought, what would be better then to make an app that could give anyone Justin Bieber&#8217;s hair du? I mean, [...]]]></description>
			<content:encoded><![CDATA[<p><a style="display:block;" href="http://itunes.apple.com/us/app/bieberfy/id388475374?mt=8"><br />
<img style="display:block;margin:auto;margin-left:auto;margin-right:auto;" src="http://img.skitch.com/20100923-m4d99j6ukq6iexc9xe7cxen9y4.png" alt="BieberFy Icon" /><br />
<img style="display:block;margin:auto;margin-left:auto;margin-right:auto;" src="http://img.skitch.com/20100923-tfys8j49dm3rpckhpqhp2mf5t3.png" alt="BieberFy Logo" width="200" height="50" /><br />
</a></p>
<p>Here at Blazing Cloud we are happy to announce the launch of our first official product, <a href="http://itunes.apple.com/us/app/bieberfy/id388475374?mt=8">BieberFy</a>! BieberFy was inspired by Justin Bieber and the overwhelming response to his floppy teenage hair cut. So we thought, what would be better then to make an app that could give anyone Justin Bieber&#8217;s hair du? I mean, haven&#8217;t you always wondered what you would look like with Justin Bieber&#8217;s hair? Okay, maybe thats a stretch, wondering what you would look like with Justin Biebers likeness and all, but if  your curiosity gets the better of you there IS an app for that now.</p>
<p>BieberFy is an application that runs on iOS 4 for the iPhone and iPod touch. BieberFy takes advantage of the devices built in camera by displaying an overlay that gives you three Justin Bieber hair styles to choose from.  The initial version of the app allows you to take a photo with one of the hair styles, preview it and if you choose to accept, it will save it to the device&#8217;s built in photo album.</p>
<p>BieberFy is available for sale world wide via the iTunes app store for $0.99.</p>
<p>We hope you have just as much fun with this app as we do!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blazingcloud.net/2010/09/23/bieberfy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Objective-C Gets Blocks!</title>
		<link>http://blog.blazingcloud.net/2010/06/28/objective-c-gets-blocks/</link>
		<comments>http://blog.blazingcloud.net/2010/06/28/objective-c-gets-blocks/#comments</comments>
		<pubDate>Mon, 28 Jun 2010 15:51:45 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Objective-c]]></category>

		<guid isPermaLink="false">http://blazingcloud.net/?p=858</guid>
		<description><![CDATA[New to Objective-C is the block syntax. A block is a section of code that is grouped together and designed to be treated like one statement. Blocks also package up the lexical scope of variables and functions within its environment. Blocks are found in many languages including, but not limited to, Ruby, Javascript and Lisp. [...]]]></description>
			<content:encoded><![CDATA[<p>New to Objective-C is the block syntax. A block is a section of code that is grouped together and designed to be treated like one statement. Blocks also package up the lexical scope of variables and functions within its environment. Blocks are found in many languages including, but not limited to, Ruby, Javascript and Lisp. Blocks are objects and should be treated like such!</p>
<table border="1" cellpadding="2px">
<tbody>
<tr>
<th>Programming Language</th>
<th>Code Example</th>
<th>Colloquial</th>
</tr>
<tr>
<th>Ruby</th>
<td>
<pre class="crayon-plain-tag">[1, 2, 3, 4].each do |i|
    puts i
end</pre>
</td>
<td>Block</td>
</tr>
<tr>
<th>Lisp</th>
<td>
<pre class="crayon-plain-tag">((lambda (a b) (+ b a)) 1 2)</pre>
</td>
<td>Lambda function</td>
</tr>
<tr>
<th>Javascript</th>
<td>
<pre class="crayon-plain-tag">var foo = function () {
   var j = 42;
}</pre>
</td>
<td>Anonymous Function, Closure</td>
</tr>
<tr>
<th>Objective-C</th>
<td>
<pre class="crayon-plain-tag">^BOOL(num1,num2){
   return [num1 isEqualToNumber:num2];
}</pre>
</td>
<td>Block</td>
</tr>
</tbody>
</table>
<p>Now there are other block structured languages out there but the few listed here are used to provide a basis for understanding if you&#8217;re coming from another language where you may have experienced this concept.</p>
<p>Objective-C inherited blocks from the C language, which it is a superset of. Apple has created an extension of the C language implementing blocks.  Syntactically, blocks start with the carrot symbol, followed by its return type followed by arguments (enclosed by parenthesis) and finishing off with the code body defined between curly braces.</p>
<p>^Return Type (Arguments) {Code Body}</p>
<p>The blocks return type and arguments are both optional parameters, leaving them off will not effect the block.</p>
<p>^{Code Body}</p>
<p>You can pass blocks to a function:</p><pre class="crayon-plain-tag">Repeat(12, ^{
   [str appendFormat:@&quot;rand: %d&quot;, rand()];
});</pre><p>Scoped variables (by default) are immutable in blocks. To make these mutable you prefix the keyword __block.</p>
<p>For example</p><pre class="crayon-plain-tag">__block int count = 0; //mutable thanks to the __block keyword
int specialValue = 50;  //immutable inside the block

^{
  // do some calculation
   int newValue = someCalculatedValue + specialValue;
   count++; //increment the count every time we do this calculation
}</pre><p>A good example of when you might want to use a block may be a callback. Since callbacks are generally a grouping of code that will run after an operation.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blazingcloud.net/2010/06/28/objective-c-gets-blocks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WWDC Day One</title>
		<link>http://blog.blazingcloud.net/2010/06/14/wwdc-day-one/</link>
		<comments>http://blog.blazingcloud.net/2010/06/14/wwdc-day-one/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 00:31:41 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[iPod]]></category>
		<category><![CDATA[Objective-c]]></category>
		<category><![CDATA[WWDC]]></category>

		<guid isPermaLink="false">http://blazingcloud.net/?p=849</guid>
		<description><![CDATA[Apples annual conference kicked off last week and Blazing Cloud wasn&#8217;t about to miss it&#8217;s chance to attend. Many exciting things happened like a preview of the 4th generation iPhone, a preview of developer tools and a look into safari improvements. The keynote also offered up some interesting statistics and new device capabilities of iPhone [...]]]></description>
			<content:encoded><![CDATA[<p>Apples annual conference kicked off last week and Blazing Cloud wasn&#8217;t about to miss it&#8217;s chance to attend. Many exciting things happened like a preview of the 4th generation iPhone, a preview of developer tools and a look into safari improvements. The keynote also offered up some interesting statistics and new device capabilities of iPhone 4 that we wanted to share with you.</p>
<h2>iBooks</h2>
<p>In the first 65 days users have download over 5 million books</p>
<h3>Enhancement to iBooks</h3>
<p>Highlight sections<br />
Make notes<br />
Bookmark the page in the corner<br />
View and read PDFs</p>
<h2>AppStore</h2>
<p>Apple supports two platforms, HTML5 and AppStore (225,000 apps)<br />
15,000 apps submitted every week supporting up to 30 languages<br />
95% of apps are approved in 7 days<br />
5% of apps get rejected</p>
<h3>Reason why apps are rejected from the AppStore</h3>
<p>Use of private Apple APIs<br />
App doesn&#8217;t work like developer says it works<br />
The app crashes</p>
<p>Downloads from the AppStore total 5 billion<br />
$1 billion dollars have been paid out to developers thus far</p>
<h2>iPhone stats</h2>
<h3>Us smartphone market share Q1 of 2010</h3>
<p>RIM 35%<br />
iPhone 28%<br />
Winmo 19%<br />
Android 9%<br />
Other 9%</p>
<h3>US mobile browsers share Q1 of 2010</h3>
<p>iPhone 58.2%<br />
Android 22.7%<br />
Rim 12.7%<br />
Other 6.4%</p>
<h2>iPhone 4</h2>
<h3>1st new feature</h3>
<p>All new design<br />
9.3 mm thick<br />
&#8220;Thinnest smartphone on the planet&#8221;<br />
Camera and LED flash<br />
2nd mic for noise cancellation<br />
Integrated Antennas in the structure of the phone<br />
Stainless steel body<br />
Glass on front and back</p>
<h3>2nd new feature</h3>
<p>Retina display<br />
4 times as many pixels in the same area<br />
326 pixels per inch<br />
300 pixels per inch is the limit of the human retina to differentiate pixels<br />
3.5 inches 960&#215;640<br />
800:1 contrast ratio<br />
IPS technology<br />
78% of the pixels on the iPad on the iPhone</p>
<h3>3rd new featured</h3>
<p>Powered by the A4 processor<br />
3G talk time equals 7 hours<br />
3G browsing time equals 6 hours<br />
WIFI browsing time equals 10hours<br />
32G and 16G storage options</p>
<h3>4th new feature</h3>
<p>3 Axis Gyroscope<br />
Pitch, roll and yaw<br />
Rotation about gravity<br />
Gyro plus accelerometer provides 6 axis</p>
<h3>5th new feature</h3>
<p>New camera system<br />
5megapixel sensor<br />
Backside illuminated sensor<br />
5x digital zoom<br />
LED flash built in<br />
HD video recording 720p at 30 frames per sec<br />
Built in video editing (iMovie application)<br />
LED flash will stay on for video</p>
<h3>6th new feature</h3>
<p>Renaming iPhone OS to iOS 4<br />
1500 new developer APIs<br />
100 new user features<br />
Multitasking<br />
Folders<br />
Added bing as a search option (with google and yahoo)</p>
<p>Golden master candidate released June 7th</p>
<p>100th million iOS device (iPhone + ipads + iPods) sold</p>
<h3>7th new feature</h3>
<p>iBooks coming to iPhone<br />
Same features as the iPad<br />
Wireless sync between iPhone, iPad and iPod touch<br />
Same books for all devices at no extra charge</p>
<p>150 million accounts with credit cards (iBook store, AppStore and iTunes Store)<br />
Over 16 billion downloads from all three stores</p>
<h3>8th new feature</h3>
<p>iADs<br />
Ads keep you in your app which gives a better user experience<br />
Built right into iOS4<br />
Brands so far to sign up (within the last 8 weeks): Nissan, Citi, unilever, AT&amp;T, Chenel, GE, liberty mutual, State Farm, Gieco, Cambell, Sears, JCPennys, Target, Best Buy, DirecTV, tbs, and Disney</p>
<p>These companies committed 60 million dollars towards iAds</p>
<h3>9th new feature</h3>
<p>FaceTime video calling<br />
Uses wifi, no setup required<br />
Use front or rear camera<br />
Wifi only in 2010 have to work with the cellular companies to get their networks ready for video calling</p>
<h2>Price and availability</h2>
<p>2 colors white or black<br />
$299 for 32 gig $199 for 16 gig<br />
On sale June 24th<br />
Pre-sale June 15th</p>
<p>iOS 4 upgrades are free for everyone (iPhone + iPod Touch)!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blazingcloud.net/2010/06/14/wwdc-day-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
