Brian Corrales
corralesonline.com

About Brian Corrales

For the past 10 years, I have been involved with web development and online marketing. Last year, I graduated with a Bachelor of Information Systems Management degree from Brigham Young University's Marriott School of Management. I have a background in Accounting, Marketing and Supply Chain Management. My technical background includes Database and Systems Design, Project Management, and Enterprise Architecture.

Besides developing online applications, I own and operate Wasatch Martial Arts, which specializes in quality instruction of the Korean martial art, Soo Bahk Do.



 

News Update

August 2nd, 2008 . by brian.corrales

I haven’t written a post on here for quite a while.  Things have been pretty crazy with my work at DeseretBook.com.  We’ve launched the new retail site as beta and it should be replacing the old system within the next couple of weeks.  That project has been really long, but very fulfilling.  There’s quite a few updated and new features on the site along with a killer new design.  Feel free to check it out.

Besides that, I’ve been preparing myself for Ko Dan Ja Shim Sa, which is an 8 day test to become a 4th dan in Soo Bahk Do.  I’m also testing for my Sa Bom which denotes a “master-level instructor”.  The dates are set for August 14-22 which is in less than two weeks!

So those two items have made blogging really hard to do lately.  My wife on the other hand has started her own blog about our family.  She’s done a really nice job.  I hope everyone will check it out and make a few comments (she loves comments).  http://familiacorrales.blogspot.com.

[?]
Share This

Rails Conference 2008

June 2nd, 2008 . by brian.corrales

This past weekend I was in Portland, Oregon attending Rails Conference 2008.  It was a great event and I learned a lot.  The event lasted from Thursday to Sunday and I was able to attend quite a few tutorials, sessions, and presentations.  There were nearly 2000 rails developers in attendance!   I was impressed with the Conference Center and the catered meals that were provided.  I thought the event was very organized.

What really stood out for me was the presentation on Rails 2.1 which was made available over the weekend.  Rails 2.1 has a lot of great new features including better caching, gem dependencies, and time zone support.  One new addition that really struck my attention was versioned migrations.  A time stamp will now be at the beginning of the migration filename.  Having version control to my migrations will save me a lot of headaches.

Now you can do this:

script/generate migration one
      create  db/migrate/20080402122512_one.rb

The number at the end is a time stamp.  You can then retrack your steps by typing:

rake db:migrate:up VERSION=20080402122512

One other cool addition is the modification to ActiveRecord.  Say you wanted to find all your blog posts.  The command would be Post.find(:all).  With Rails 2.1, we’ll be able to simply write Post.all and Post.first.  Seems pretty intuitive.

I know it’ll probably take a little bit of work to upgrade my applications, but you gotta hand it to the Rails Team.  Version 2.1 is awesome!



[?]
Share This

Jury Duty SCAM!

March 14th, 2008 . by brian.corrales

A new type of scam is running through the U.S. and people are actually falling for it.  Read below:

Ricki Brown
Control Specialist
Willingboro PDC
Ext. 2045
JURY DUTY SCAM:

This has been verified by the FBI (their link is also included below).

Please pass this on to everyone in your email address book.

It is spreading fast so be prepared should you get this call. Most of us take those summons for jury duty seriously a new and ominous kind of fraud has surfaced.
The caller claims to be a jury coordinator. If you protest that you never received a summons for jury duty, the scammer asks you for your Social Security number and date of birth so he or she can verify the information and cancel the arrest warrant.

Give out any of this information and bingo, your identity was just stolen.
The fraud has been reported so far in 11 states, including New York , Oklahoma , Florida , Illinois , Texas and Colorado .

This (swindle) is particularly insidious because they use intimidation over the phone to try to bully people into giving information by pretending they are with the court system.
The FBI and the Federal Court System have issued nationwide alerts on their web sites, warning consumers about the fraud.

Snopes site: says this is real fraud.

http://www.snopes.com/crime/fraud/juryduty.asp<http://www.snopes.com/crime/fraud/juryduty.asp>;

FBI site: warns about the fraud.

[?]
Share This

RAILS 2.0 Sessions

February 13th, 2008 . by brian.corrales

So I just updated a project to RAILS 2.0. There’s been a few stumbles on the way, but the main issue I came across was Sessions. It seems that the RAILS team has decided to move away from file-system sessions to cookie sessions. Cookies seem to be much faster than the old file system. The only draw back is that it forces you to utilize session variables as intended…sparingly. Cookies are generally limited to only 4K. There really isn’t any need for you to ever store more than this in your session anyway. It’s just not considered best-practices.

So if you are upgrading to Rails 2.0 and you get some errors, such as a 500 Error, be sure to check how you are handling sessions. Regardless, you’ll need to add the following code into your environments.rb file (don’t forget to restart your server):

config.action_controller.session = { 
  :session_key => _my_app_session, 
  :secret      => hashed_key_of_at_least_30_characters 
}

If you want to read the documentation, here’s the link: http://caboo.se/doc/classes/CGI/Session/CookieStore.html .

For a really good discussion on Sessions and RAILS, go here.

[?]
Share This

Ordering Eager-loaded Data

February 1st, 2008 . by brian.corrales

If you are using Active Record with Ruby on Rails, I’m sure you’re familiar with the :include symbol for the find method. Here’s an example where we have a category structure of Categories -> SubCategories:

@category = Category.find(params[:id], :include => [:sub_categories])

This will find the category with id = params[:id] and will eager load all of the related sub categories. This way we only need to run one query, rather than two. We could also do this

@category = Category.find(params[:id], :include => [:sub_categories, {:sub_categories => :products }])

Now we are going down another level and retrieving all products related to each sub_category. Unfortunately, there is no way to go travel further into your data model with the :includes symbol. If anyone has a good approach, I’m all ears.

The problem I’ve run into is that my Category model has has_many :sub_categories, :order => ‘rank asc’. When I include :sub_categories, Active Record does not recognize my ordering. This caused me quite a few headaches until I came across this in the docs:

” Since the eager loading pulls from multiple tables, you‘ll have to disambiguate any column references in both conditions and orders. So :order => “posts.id DESC” will work while :order => “id DESC” will not. Because eager loading generates the SELECT statement too, the :select option is ignored.” Here’s the link:

So the best approach would be @category = Category.find(params[:id], :include => [:sub_categories, {:sub_categories => :products}], :order => “categories.rank, sub_categories.rank”)

This will order your categories and sub categories. Hopefully someone finds this useful. If you have come up with a better approach, please let me know.

[?]
Share This

New Blog

January 26th, 2008 . by brian.corrales

I’ve finally decided that my blog is too disjointed. If you are interested in my martial arts related posts, please go to http://blog.wasatchmartialarts.com.

[?]
Share This

RMagick Errors with Windows

December 24th, 2007 . by brian.corrales

If you are experiencing an unusual ruby error after installing RMagick, before digging too deep, try not only rebooting your web server, but Windows itself.  That fixes a ton of possible errors that could result from a RMagick installation. The error I had was RMagick.so not found.

[?]
Share This

Star Wars Rocket Launch

December 12th, 2007 . by brian.corrales

Check this out.  A real X-Wing Fighter straight out of Star Wars has been built.  Pretty cool launch.  Not sure if I’d spend $5000 on it though…

[?]
Share This

NEW Tiger Tots Class

November 27th, 2007 . by brian.corrales

Finally, Wasatch Martial Arts will have a Tiger Tots class designed specifically for kids ages 4 to 6. It’s a fun program designed to teach young kids discipline, respect, coordination, and self confidence. The class will prepare them to enter the older kids class later on. If you would like to register your child click here.

[?]
Share This

Hu Ri - Soo Bahk Do’s Unique Use of Hip

November 17th, 2007 . by brian.corrales

I am often asked what makes Soo Bahk Do unique from other martial arts systems.  Though there are many facets of Soo Bahk Do that differentiate it from other systems, possibly the characteristic that has had more impact on the martial arts community is our unique method of hip twisting and thrusting.  Here is a small video clip of the successor of the Moo Duk Kwan founder, Hyun Chul Hwang Kwan Jang Nim as he explains the physics behind our unique use of hip:

Use of Hip

[?]
Share This

« Previous Entries