Sunday, April 29, 2012

Sync RVM with TextMate

I've been trying to sync TextMate with RVM found this tutorial extremely helpful.

Basic Process:
  1. Print path to RVM-AUTO-RUBY ( the exec file that runs the default interpreter set by rvm )
    • Unix command: $ which rvm-auto-ruby
  2. Copy path to TextMate's preferences
    • Under TextMate > Preferences > Advanced > Shell Variables create a new shell variable 
    • Variable: TM_RUBY
    • Value: ( path returned by which rvm-auto-ruby cmd )
Debugging Tips:
  • Print out path to current ruby interpreter 

Tuesday, April 24, 2012

1: Programming Review

Project description.
Concerns
  • line 21: I'm not sure if this is the best way to check the command line inputs and save them.
  • line 27: I feel like there should be a way to combine this with line 24? like or die in perl 
  • I can't believe the there aren't any Math.sum Math.average or Math.median functions but I do like the way you can easily insert methods into a core class ( line 1 - 11 )
  • line 31 - 36: I swear I've heard of an cleaner way to parse in a file, but my solution works 
  • line 40: I'm not really sure what ensure does
  • line 2: inject(:+) ??? what the crap? this is cool, but not intuitive at all. Someone please explain
  • I could make it a little more object oriented by making a print result method ... but meh
Let me know what you think. 

Blog init

Blog.what?
Here are some sample projects from my CIS 206 Discrete Mathematics class. The course is taught by Geoffrey Draper at BYU-Hawaii.  In our class, we are permitted to program in any language of our choice. I've decided to take advantage of that freedom to try and learn Ruby. I'm using Ruby 1.9.2

Blog.why? 
I've decided to blog my projects for the following reasons:

  • My programs will be helpful to others who learn Ruby
  • People's comments will help me learn Ruby faster
  • It's a personal programming journal
end