Author Archive
Ordering Eager-loaded Data
by brian.corrales on Feb.01, 2008, under Ruby on Rails
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.
New Blog
by brian.corrales on Jan.26, 2008, under Martial Arts
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.
RMagick Errors with Windows
by brian.corrales on Dec.24, 2007, under Ruby on Rails, Technology
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.
Star Wars Rocket Launch
by brian.corrales on Dec.12, 2007, under Other
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…
NEW Tiger Tots Class
by brian.corrales on Nov.27, 2007, under Martial Arts
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.
Hu Ri - Soo Bahk Do’s Unique Use of Hip
by brian.corrales on Nov.17, 2007, under Martial Arts
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:
The Ryu Pa of the Moo Duk Kwan
by brian.corrales on Nov.10, 2007, under Martial Arts
Ryu Pa is a Korean term that means “a river flowing down divided”. This is the term used for the word “style”. The Moo Duk Kwan style was created by the late Hwang Kee. To understand his style, it is important to understand his martial arts training. Hwang Kee’s training can be divided into 4 specific areas.
When Hwang Kee was only 7, he witnessed a fight with a Tae Kyun master defend himself against a large group of men. Hwang Kee was so impressed that he followed the man home and eventually asked to learn. Hwang Kee was refused because he was too young. Determined, Hwang Kee woud watch from a distance as the master would teach Tae Kyun. Though he never received formal training in Tae Kyun, some considered him a master in his own right by the age of 22.
Later, Hwang Kee went to Manchuria to work on the railroad. There he was able to train with Yang Kuk Jin, a master of the Chinese martial arts. Here Hwang Kee received his only formal training which included Seh Bop (Postures), Bo Bop (steps) and Ryun Bop (Conditioning). He also trained in Dham Toi Sip E Ro (12 Step Tan Tui) and Tae Kuk Kwon (Tai Chi).
When Hwang Kee returned to Korea, he ready books on Okinawan Karate. The exact titles are unknown.
After World War II, Hwang Kee opened a school teaching a new system that he created called Hwa Soo Do. This style was heavily influenced by his training in Manchuria. However, because of the Japanese Occupation of Korea, his art was not very well received. One day, he spoke with the founders of Ji Do Kwan and Chung Do Kwan. Chung Do Kwan was teaching Tang Soo Do, which had roots in Shotokan. Ji Do Kwan was teaching Kong Soo Do, which had roots in Judo. Both of these styles had many more students than the Moo Duk Kwan. After meeting these two founders, Hwang Kee decided he needed to integrate the art of “Tang Soo Do” into the Hwa Soo Do discipline. At the time, Tang Soo Do was the only term for a “Karate-type” discipline that the public would recognize and accept because of their Japanese doctrinization during the past 50 years. From the knowledge he had acquired from studying Japanese books, he began teaching Tang Soo Do while applying the Hwa Soo Do discipline of techniques. This included a unique use of offensive and defensive hip movements in all hand techniques. Kicks also had a unique way of extending the hips on all thrust kicks. These along with other characteristics distinguished the Moo Duk Kwan system from others teaching “Tang Soo Do”.
In 1957, Hwang Kee discovered the Moo Yei Do Bo Tong Ji, the oldest Korean martial arts text known today. Inside, he discovered a fighting art called “Soo Bahk Ki” or Soo Bahk Hee” which means hand striking techniques or dance. He recognized the importance of “Soo Bahk” as a Korean traditional martial art and studied the book in depth. The Moo Duk Kwan began another transformation as Hwang Kee implemented the Soo Bahk system into the Moo Duk Kwan. This implementation has continued until the present day where the Moo Duk Kwan now practices forms taken from and based upon the teachings from the Moo Yei Do Bo Tong Ji. In the 1990’s, the Moo Duk Kwan in the United States formally changed its name from the United States Tang Soo Do Moo Duk Kwan Federation to the United States Soo Bahk Do Moo Duk Kwan Federation. The change of the name outwardly demonstrates the Moo Duk Kwan’s change of focus from the Tang Soo Do curriculum that had a strong base in the Okinawan Karate forms to the unique Soo Bahk Do forms created by Hwang Kee such as Chil Sung, Yuk Ro, and Hwa Sun.
The Moo Duk Kwan today teaches the combined knowledge that Hwang Kee left to his son and successor, Hwang Hyun Chul. The system is largely influenced by his teacher in China and his findings in the Moo Yei Do Bo Tong Ji along with his unique findings on the execution of basic techniques (unique use of hip). The “Tang Soo Do” forms are also taught, but less emphasis is placed on them today.
Children’s Classes Begin Sept 10
by brian.corrales on Aug.26, 2007, under Martial Arts
To register for Soo Bahk Do, go to my beta site. It’s not much, but it at least allows for online registration. Please contact me if you have any questions.
Soo Bahk!
Brian
Skype Down
by brian.corrales on Aug.16, 2007, under Technology
OK, it’s not a firewall issue like I thought. I haven’t been able to log into skype all day. I’ve looked at my firewall configurations, nothing. Apparently, Skype is down for the day. I also didn’t realize they came out with a new version. I’m probably really behind, but the download is down as well.
Soo Bahk Do in Utah
by brian.corrales on Aug.12, 2007, under Martial Arts
Finally we’re making some progress in forming a legitimate Soo Bahk Do school in Utah. Beginning next Thursday, I’ll be holding an adult class in Sugarhouse next to Salt Lake. These classes will be held every Tuesday and Thursday. Classes are being held in the backyard of the most senior student, Ms. Smith who is a Cho Dan until we can find a more permanent location.
Leave a comment if you are interested in joining the class. We will be learning the traditional Korean martial art along with its history, tradition, and philosophy. The classes will be free until the beginning of next month.