2013年8月9日金曜日

[Why's] 4.Floating Little Leaves of Code

  • http://mislav.uniqpath.com/poignant-guide/book/chapter-4.html
  • 1. The Leaf as a Status Symbol in Ambrose
    • Animal Perfect L.L.C. is a firm, which build new animals and salvage old-style animals for parts.
    • Starmonkeys are one of such animals.
    • "A lot of Rubyists like to think of methods as a message."
    • A Ruby program consists of two parts:
      1. Defining things.
      2. Putting those things into action.
    • Assignment (=) is the simplest example of defining something in Ruby.
    • Starmonkey creation process looks in Ruby as follows:
      starmonkey = ratchet.attach( captive_monkey, pipe.catch_a_star ) + deco_hand_frog
      
  • 2. Small and Nearly Worthless
    • Nil: "In Ruby, nil represents an emptiness."
    • False: "Generally speaking, everything in Ruby has a positive charge to it. This spark flows through strings, numbers, regexps, all of it. Only two keywords wear a shady cloak: nil and false draggin’ us down."
    • True: "To be honest, I can’t be around someone who always has to be right. This true is always saying, 'A-OK.'"
  • 3. Chaining Delusions Together
    • TBW
  • 4. The Miracle of Blocks
    • TBW

[Why's] 3.A Quick (and Hopefully Painless) Ride Through Ruby (with Cartoon Foxes)

  • http://mislav.uniqpath.com/poignant-guide/book/chapter-3.html
  • "My conscience won’t let me call Ruby a computer language." A fascinating expression.
  • "We can no longer truthfully call it a computer language. It is coderspeak. It is the language of our thoughts." Okay. I agree with the author about this characteristic of Ruby but...
    • Schemers may say "We use not English but abstract trees of data and codes when we design and analyze programs.",
    • Haskeler may say "You can't prove your correctness. We should change our way of thinking. Category theory is an alternative mathematical...",
    • Common Lisper may say "Ah, that's a kind of the loop macro. Some love that kinda stuff. But others don't. Enjoy."
  • "Try to focus on the look of each of these parts of speech. The rest of the book will detail the specifics. I give short descriptions for each part of speech, but you don’t have to understand the explanation. By the end of this chapter, you should be able to recognize every part of a Ruby program." This is practical and effective way to start introducing a language. This long section, "2. The Parts of Speech" provides exactly this type of quick tour of Ruby. Good.


2013年8月8日木曜日

[Why's] 2. Kon’nichi wa, Ruby

  • http://mislav.uniqpath.com/poignant-guide/book/chapter-2.html
  • This chapter looks a scene setting or an concensus process between the author and readers. The chapter contains little information about Ruby itself.
  • In a nutshell, important information in the chapter as an introductory book for Ruby is:
    1. At first sight, the author thought Ruby was meaningless. But later they clicked. (That can happen to you as well.)
    2. By learning Ruby, you may be able to improve your brain performance.
    3. Using Ruby costs nothing.
    4. Enjoy cartoons with foxes.

[Why's] 1.About this Book

  • http://mislav.uniqpath.com/poignant-guide/book/chapter-1.html
  • Haha. Just nonsense.

Why's (Poignant) Guide to Ruby

Let me get something straight: I just would like to learn writing programs in Ruby. I don't need any grammatical explanations if I can write Ruby programs without them. Moreover, I don't need any author's grammatically-looking half-baked explanations, because they are just confusing. Basically, usage and pragmatics are important for me.

The next material I would like to try is http://mislav.uniqpath.com/poignant-guide/book/. Hope this meets my requirements.

[Ruby Tutorial] Numbers in Ruby

I like numbers. :-)
  • http://rubylearning.com/satishtalim/numbers_in_ruby.html
  • The author uses the word "literal" with no explanation. So, this tutorial must be not for programming newbies.
  • "In Ruby, numbers without decimal points are called integers", this statement is wrong. For example "1234e-2" is a floating point number.
  • Class Hierarchy
    • This diagram is very interesting. Ruby has Object class and Class class. Okay. In that case, using the term "object" may sound confusing, ex. "objects of Object class", "Object is a super class of Class class". Should I use "instance" and avoid "object"?
    • The spec uses both. "Classes in Ruby are first-class objects---each is an instance of class Class." Interesting. See http://www.ruby-doc.org/core-2.0/Class.html
  • IMHO, REPL or irb is a good tool to try and learn this kind of basic feature of Ruby but the author doesn't use it in this tutorial so far.
Okay. I will give up this tutorial here, unfortunately. I don't recommend you to use this material as an introduction to Ruby.

[Ruby Tutorial] Some Features of Ruby

  • http://rubylearning.com/satishtalim/features.html
  • Statement delimiters
    • This tutorial says "a linefeed is treated like a semicolon." Then, how about a carige return?A little bit interesting.
    • The ruby specification, http://www.ruby-doc.org/core-2.0/doc/syntax/miscellaneous_rdoc.html, says "Ruby uses a newline as the end of an expression." Then, what's a newline? Perhaps, there is no standardized rule for this topic but UTR#13, an effort in Unicode, is worth referencing: http://www.unicode.org/standard/reports/tr13/tr13-5.html
    • The tutorial uses the word "statement" while the spec uses "expressions." AFAIK, statements and expressions are different entities in computer languages. Also, I'm not sure Ruby has statements.
    • Consequently the description in the tutorial is incorrect or insufficient.
    • I'm not a "language lawyer." I just wandered why the author didn't use the original description in the spec: "Ruby uses a newline as the end of an expression." This is more concise and informative than the author's explanation.
  • Keywords
    • I don't understand why the author included a description about truth value treatment of Ruby here, esp. in an item about Keywords.
    • As for truth values, Ruby and CL looks quite similar. CLers expect the truth value of everything other than nil or '() is non-nil.

[Ruby Tutorial] My First Ruby Program

  • http://rubylearning.com/satishtalim/first_ruby_program.html
  • A typical "hello world" session. This is not interesting but inevitable.

[Ruby Tutorial] Ruby Installation

  • http://rubylearning.com/satishtalim/ruby_installation.html
  • This tutorial may be tightly bound to Rails to motivate newbies to learn Ruby. This tells me that Rails is still a killer application for Ruby, and there is no other killer application for Ruby thus far after Rails.

[Ruby Tutorial] Introduction

  • http://rubylearning.com/satishtalim/introduction.html
  • This chapter is well-written and concise, but contains nothing interesting.

Tutorial on Rubyleaning.com

Okay. Let's back to learning Ruby. The next material I would like to try is rubyleaning.com or <http://rubylearning.com/satishtalim/tutorial.html>. This is a free online material, which enables me to link from my blog entries that decrease the amount of citation from original text. I may quit somewhere in the middle of the material when I feel bored. I'm still in a kind of rehabilitation to learn computer science and boring materials are extremely harmful for me to rebuild CS study into my life.

Which Version Should I Use on Mac? 1.8, 1.9 or 2.0? And How?

Here are comparisons between 1.8 and 1.9 as well as 1.9 and 2.0.

  • http://stackoverflow.com/questions/21574/what-is-the-difference-between-ruby-1-8-and-ruby-1-9
  • http://stackoverflow.com/questions/15799687/what-are-the-major-differences-between-ruby-1-9-3-and-ruby-2-0-0

Version 2.0 looks fine. Also, Rails4's primary target of ruby version is 2.0. One small caveat is most ruby books have not yet revised for 2.0. But the differences between 1.9.3 and 2.0.0 is so small and that won't hurt learning process. Okay. Let's go with 2.0.

Next. How? I've found an informative blog entry about this.

  • http://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/#step-1

So, I'd like to put here a journal of what I did on my mac (MBP15, OSX10.8.4) following above entry.

  • Download and Install the Command Line Tools via Xcode
    • I had Xcode in my mac ,so followed only the procedures to install CLT via Xcode.

  • Fix Homebrew errors and warnings, and update
    • I have Homebrew but don't use it on a daily basis. So, firstly check and fix current errors and warnings with brew doctor.
      $ brew doctor
      Warning: You have uncommitted modifications to Homebrew
      If this a surprise to you, then you should stash these modifications.
      Stashing returns Homebrew to a pristine state but can be undone
      should you later need to do so for some reason.
          cd /usr/local/Library && git stash && git clean -d -f
      
      Warning: /usr/bin occurs before /usr/local/bin
      This means that system-provided programs will be used instead of those
      provided by Homebrew. The following tools exist at both paths:
      
          git
          git-cvsserver
          git-receive-pack
          git-shell
          git-upload-archive
          git-upload-pack
      
      Consider amending your PATH so that /usr/local/bin
      occurs before /usr/bin in your PATH.
      
      Warning: Your Homebrew is outdated.
      You haven't updated for at least 24 hours, this is a long time in brewland!
      To update Homebrew, run `brew update`.
      $
    • Secondly, fix them.
      1. Uncommitted modification problem
        $ cd /usr/local/Library && git stash && git clean -d -f
        cd /usr/local/Library && git stash && git clean -d -f
        No local changes to save
        Removing Aliases/fsa
        Removing Aliases/omake
        Removing Contributions/cmds/
        Removing Contributions/install_homebrew.rb
        Removing Formula/abyss.rb
        Removing Formula/blast.rb
        Removing Formula/bowtie.rb
        Removing Formula/bwa.rb
        Removing Formula/chmox.rb
        Removing Formula/cliweather.rb
        Removing Formula/clojure-contrib.rb
        Removing Formula/clustal-w.rb
        Removing Formula/cufflinks.rb
        Removing Formula/dia.rb
        Removing Formula/emboss.rb
        Removing Formula/fast-statistical-alignment.rb
        Removing Formula/fastx_toolkit.rb
        Removing Formula/gmap-gsnap.rb
        Removing Formula/gmock.rb
        Removing Formula/haxe.rb
        Removing Formula/hmmer.rb
        Removing Formula/knife-completion.rb
        Removing Formula/libpar2.rb
        Removing Formula/mira.rb
        Removing Formula/mod_python.rb
        Removing Formula/mod_wsgi.rb
        Removing Formula/mosh.rb
        Removing Formula/mosml.rb
        Removing Formula/mrfast.rb
        Removing Formula/muscle.rb
        Removing Formula/netsed.rb
        Removing Formula/o-make.rb
        Removing Formula/paml.rb
        Removing Formula/phyml.rb
        Removing Formula/plink.rb
        Removing Formula/primer3.rb
        Removing Formula/prodigal.rb
        Removing Formula/quickfix.rb
        Removing Formula/quicktree.rb
        Removing Formula/rails-completion.rb
        Removing Formula/rats.rb
        Removing Formula/samtools.rb
        Removing Formula/staticrouted.rb
        Removing Formula/synergy.rb
        Removing Formula/tabix.rb
        Removing Formula/tophat.rb
        Removing Formula/transcode.rb
        Removing Formula/uif2iso.rb
        Removing Formula/velvet.rb
        Removing Formula/vimeo-downloader.rb
        Removing Formula/xaw3d.rb
        Removing Formula/xml2rfc.rb
        Removing Homebrew/pkgconfig/
        Removing Homebrew/test/test_external_deps.rb
        Removing Homebrew/vendor/multi_json/
        $ 
      2. Path problem. At the time of install, Homebrew appended /usr/local/bin at the end of /etc/paths. So, it's a little bit strange for brew doctor to warn up the order problem. Anyway, one way to fix this problem is change the order of paths in /etc/paths but you shouldn't. It affects command selection system-widely. You should modify something bound to more smaller part of your system such as your account or your programming environment like shell or emacs.

        Let's begin with shell. There are three famous configuration file for shell which are loaded when a shell starts: .profile, .bash_profile and .bashrc. Here is a stack overflow entry that explains the difference between them.
        • http://stackoverflow.com/questions/415403/whats-the-difference-between-bashrc-bash-profile-and-environment

        Okay. Editing $PATH in .bashrc with "if [ -f ~/.bashrc ]; then; source ~/.bashrc; fi" in .bash_profile sounds good as my start point. I created .bash_profile and added "export PATH=/usr/local/bin:/usr/local/sbin:$PATH" at the end of my .bashrc.

        Next. Emacs. I already have
        (defun set-exec-path-from-shell-PATH ()
          "Sets the exec-path to the same value used by the user shell"
          (let ((path-from-shell
          (replace-regexp-in-string
           "[[:space:]\n]*$" ""
           (shell-command-to-string "$SHELL -l -c 'echo $PATH'"))))
            (setenv "PATH" path-from-shell)
            (setq exec-path (split-string path-from-shell path-separator))))
        
        ;; call function now
        (set-exec-path-from-shell-PATH)
        in my emacs init file, which sync the emac's exec-path and PATH automatically.
      3. Outdated problem.
        $ brew update
        

    • Thirdly, recheck my Homebrew.
      $ brew doctor
      Your system is ready to brew.
      $ 
      

  • Update git.
    $ which git
    /usr/local/bin/git
    $ git --version
    git version 1.8.1.2
    $ brew update
    Already up-to-date.
    git-crypt     git-gerrit  git-url-sub     topgit
    $ brew info git
    git: stable 1.8.3.4, HEAD
    http://git-scm.com
    /usr/local/Cellar/git/1.8.1.2 (1286 files, 182M)
    /usr/local/Cellar/git/1.8.3.4 (1327 files, 29M) *
      Built from source
    From: https://github.com/mxcl/homebrew/commits/master/Library/Formula/git.rb
    ==> Dependencies
    Optional: pcre, gettext
    ==> Options
    --with-blk-sha1
     Compile with the block-optimized SHA1 implementation
    --with-gettext
     Build with gettext support
    --with-pcre
     Build with pcre support
    --without-completions
     Disable bash/zsh completions from "contrib" directory
    ==> Caveats
    The OS X keychain credential helper has been installed to:
      /usr/local/bin/git-credential-osxkeychain
    
    The 'contrib' directory has been installed to:
      /usr/local/share/git-core/contrib
    
    Bash completion has been installed to:
      /usr/local/etc/bash_completion.d
    
    zsh completion has been installed to:
      /usr/local/share/zsh/site-functions
    $ brew upgrade git
    ==> Upgrading 1 outdated package, with result:
    git 1.8.3.4
    ==> Upgrading git
    ==> Downloading http://git-core.googlecode.com/files/git-1.8.3.4.tar.gz
    ######################################################################### 100.0%
    ==> make prefix=/usr/local/Cellar/git/1.8.3.4 CC=cc CFLAGS= LDFLAGS= install
    ==> make CC=cc CFLAGS= LDFLAGS=
    ==> make clean
    ==> make CC=cc CFLAGS= LDFLAGS=
    ==> Downloading http://git-core.googlecode.com/files/git-manpages-1.8.3.4.tar.gz
    ######################################################################### 100.0%
    ==> Downloading http://git-core.googlecode.com/files/git-htmldocs-1.8.3.4.tar.gz
    ######################################################################### 100.0%
    ==> Caveats
    The OS X keychain credential helper has been installed to:
      /usr/local/bin/git-credential-osxkeychain
    
    The 'contrib' directory has been installed to:
      /usr/local/share/git-core/contrib
    
    Bash completion has been installed to:
      /usr/local/etc/bash_completion.d
    
    zsh completion has been installed to:
      /usr/local/share/zsh/site-functions
    Warning: Could not link git. Unlinking...
    Error: The `brew link` step did not complete successfully
    The formula built, but is not symlinked into /usr/local
    You can try again using `brew link git'
    
    Possible conflicting files are:
    /usr/local/share/zsh/site-functions/git-completion.bash -> /usr/local/Cellar/git/1.8.1.2/share/zsh/site-functions/git-completion.bash
    ==> Summary
     /usr/local/Cellar/git/1.8.3.4: 1327 files, 29M, built in 72 seconds
    $ brew link git
    Linking /usr/local/Cellar/git/1.8.3.4... Warning: Could not link git. Unlinking...
    
    Error: Could not symlink file: /usr/local/Cellar/git/1.8.3.4/share/zsh/site-functions/git-completion.bash
    Target /usr/local/share/zsh/site-functions/git-completion.bash already exists. You may need to delete it.
    To force the link and overwrite all other conflicting files, do:
      brew link --overwrite formula_name
    
    To list all files that would be deleted:
      brew link --overwrite --dry-run formula_name
    $ brew link --overwrite --dry-run git
    Would remove:
    /usr/local/share/zsh/site-functions/git-completion.bash -> /usr/local/Cellar/git/1.8.1.2/share/zsh/site-functions/git-completion.bash
    
    $ brew link --overwrite git
    Linking /usr/local/Cellar/git/1.8.3.4... 218 symlinks created
    $ which git
    /usr/local/bin/git
    $ git --version
    git version 1.8.3.4
    $ 
    
  • Install ruby and rails.
    $ curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enable
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100   184  100   184    0     0     37      0  0:00:04  0:00:04 --:--:--   202
    100 13784  100 13784    0     0   1944      0  0:00:07  0:00:07 --:--:--  7976
    Please read and follow further instructions.
    Press ENTER to continue.
    Downloading RVM from wayneeseguin branch stable
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100   124  100   124    0     0     63      0  0:00:01  0:00:01 --:--:--   147
    100 1081k  100 1081k    0     0   110k      0  0:00:09  0:00:09 --:--:--  219k
    
    Installing RVM to /Users/aka/.rvm/
        Adding rvm PATH line to /Users/aka/.bashrc /Users/aka/.zshrc.
    Aka  Adding rvm loading line to /Users/aka/.bash_profile /Users/aka/.zprofile.
    Installation of RVM in /Users/aka/.rvm/ is almost complete:
    
      * To start using RVM you need to run `source /Users/aka/.rvm/scripts/rvm`
        in all your open shell windows, in rare cases you need to reopen all shell windows.
    
    # Aka,
    #
    #   Thank you for using RVM!
    #   I sincerely hope that RVM helps to make your life easier and more enjoyable!!!
    #
    # ~Wayne
    
    # In case of problems:
    #      run and read: rvm notes
    #         read docs: http://rvm.io/
    #        talk to us: http://webchat.freenode.net/?channels=rvm (http://freenode.net/faq.shtml#plusr)
    #   read cheatsheet: http://cheat.errtheblog.com/s/rvm
    #  watch screencast: http://screencasts.org/episodes/how-to-use-rvm
    # open a bug report: https://github.com/wayneeseguin/rvm/issues
    
    rvm 1.21.18 (stable) by Wayne E. Seguin , Michal Papis  [https://rvm.io/]
    
    Searching for binary rubies, this might take some time.
    Installing requirements for osx, might require sudo password.
    Already up-to-date.
    Installing required packages: automake, libtool, pkg-config, libyaml, readline, libksba, openssl...................................................................................
    Certificates in '/usr/local/etc/openssl/cert.pem' already are up to date.
    Requirements installation successful.
    ruby-2.0.0-p247 - #configure
    ruby-2.0.0-p247 - #download
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 5899k  100 5899k    0     0   212k      0  0:00:27  0:00:27 --:--:--  222k
    ruby-2.0.0-p247 - #validate archive
    ruby-2.0.0-p247 - #extract
    ruby-2.0.0-p247 - #validate binary
    ruby-2.0.0-p247 - #setup
    Saving wrappers to '/Users/aka/.rvm/wrappers/ruby-2.0.0-p247'........
    ruby-2.0.0-p247 - #importing default gemsets, this may take time.......................
    Creating alias default for ruby-2.0.0-p247.
    Recording alias default for ruby-2.0.0-p247.
    Creating default links/files
    Saving wrappers to '/Users/aka/.rvm/bin'........
    Fetching: i18n-0.6.4.gem (100%)
    Successfully installed i18n-0.6.4
    Fetching: multi_json-1.7.8.gem (100%)
    Successfully installed multi_json-1.7.8
    Fetching: tzinfo-0.3.37.gem (100%)
    Successfully installed tzinfo-0.3.37
    Fetching: minitest-4.7.5.gem (100%)
    Successfully installed minitest-4.7.5
    Fetching: atomic-1.1.12.gem (100%)
    Building native extensions.  This could take a while...
    Successfully installed atomic-1.1.12
    Fetching: thread_safe-0.1.2.gem (100%)
    Successfully installed thread_safe-0.1.2
    Fetching: activesupport-4.0.0.gem (100%)
    Successfully installed activesupport-4.0.0
    Fetching: builder-3.1.4.gem (100%)
    Successfully installed builder-3.1.4
    Fetching: rack-1.5.2.gem (100%)
    Successfully installed rack-1.5.2
    Fetching: rack-test-0.6.2.gem (100%)
    Successfully installed rack-test-0.6.2
    Fetching: erubis-2.7.0.gem (100%)
    Successfully installed erubis-2.7.0
    Fetching: actionpack-4.0.0.gem (100%)
    Successfully installed actionpack-4.0.0
    Fetching: activemodel-4.0.0.gem (100%)
    Successfully installed activemodel-4.0.0
    Fetching: arel-4.0.0.gem (100%)
    Successfully installed arel-4.0.0
    Fetching: activerecord-deprecated_finders-1.0.3.gem (100%)
    Successfully installed activerecord-deprecated_finders-1.0.3
    Fetching: activerecord-4.0.0.gem (100%)
    Successfully installed activerecord-4.0.0
    Fetching: mime-types-1.23.gem (100%)
    Successfully installed mime-types-1.23
    Fetching: polyglot-0.3.3.gem (100%)
    Successfully installed polyglot-0.3.3
    Fetching: treetop-1.4.14.gem (100%)
    Successfully installed treetop-1.4.14
    Fetching: mail-2.5.4.gem (100%)
    Successfully installed mail-2.5.4
    Fetching: actionmailer-4.0.0.gem (100%)
    Successfully installed actionmailer-4.0.0
    Fetching: thor-0.18.1.gem (100%)
    Successfully installed thor-0.18.1
    Fetching: railties-4.0.0.gem (100%)
    Successfully installed railties-4.0.0
    Fetching: hike-1.2.3.gem (100%)
    Successfully installed hike-1.2.3
    Fetching: tilt-1.4.1.gem (100%)
    Successfully installed tilt-1.4.1
    Fetching: sprockets-2.10.0.gem (100%)
    Successfully installed sprockets-2.10.0
    Fetching: sprockets-rails-2.0.0.gem (100%)
    Successfully installed sprockets-rails-2.0.0
    Fetching: rails-4.0.0.gem (100%)
    Successfully installed rails-4.0.0
    Parsing documentation for i18n-0.6.4
    Installing ri documentation for i18n-0.6.4
    Parsing documentation for multi_json-1.7.8
    Installing ri documentation for multi_json-1.7.8
    Parsing documentation for tzinfo-0.3.37
    Installing ri documentation for tzinfo-0.3.37
    Parsing documentation for minitest-4.7.5
    Installing ri documentation for minitest-4.7.5
    Parsing documentation for atomic-1.1.12
    unable to convert "\xCF" from ASCII-8BIT to UTF-8 for lib/atomic_reference.bundle, skipping
    Installing ri documentation for atomic-1.1.12
    Parsing documentation for thread_safe-0.1.2
    Installing ri documentation for thread_safe-0.1.2
    Parsing documentation for activesupport-4.0.0
    unable to convert "\x80" from ASCII-8BIT to UTF-8 for lib/active_support/values/unicode_tables.dat, skipping
    Installing ri documentation for activesupport-4.0.0
    Parsing documentation for builder-3.1.4
    /Users/aka/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/parser.rb:87: warning: Unsupported encoding : ignored
    /Users/aka/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/rdoc/parser.rb:87: warning: Unsupported encoding  ignored
    Installing ri documentation for builder-3.1.4
    Parsing documentation for rack-1.5.2
    Installing ri documentation for rack-1.5.2
    Parsing documentation for rack-test-0.6.2
    Installing ri documentation for rack-test-0.6.2
    Parsing documentation for erubis-2.7.0
    Installing ri documentation for erubis-2.7.0
    Parsing documentation for actionpack-4.0.0
    Installing ri documentation for actionpack-4.0.0
    Parsing documentation for activemodel-4.0.0
    Installing ri documentation for activemodel-4.0.0
    Parsing documentation for arel-4.0.0
    Installing ri documentation for arel-4.0.0
    Parsing documentation for activerecord-deprecated_finders-1.0.3
    Installing ri documentation for activerecord-deprecated_finders-1.0.3
    Parsing documentation for activerecord-4.0.0
    Installing ri documentation for activerecord-4.0.0
    Parsing documentation for mime-types-1.23
    Installing ri documentation for mime-types-1.23
    Parsing documentation for polyglot-0.3.3
    Installing ri documentation for polyglot-0.3.3
    Parsing documentation for treetop-1.4.14
    Installing ri documentation for treetop-1.4.14
    Parsing documentation for mail-2.5.4
    unable to convert "\x80" from ASCII-8BIT to UTF-8 for lib/mail/values/unicode_tables.dat, skipping
    Installing ri documentation for mail-2.5.4
    Parsing documentation for actionmailer-4.0.0
    Installing ri documentation for actionmailer-4.0.0
    Parsing documentation for thor-0.18.1
    Installing ri documentation for thor-0.18.1
    Parsing documentation for railties-4.0.0
    Installing ri documentation for railties-4.0.0
    Parsing documentation for hike-1.2.3
    Installing ri documentation for hike-1.2.3
    Parsing documentation for tilt-1.4.1
    Installing ri documentation for tilt-1.4.1
    Parsing documentation for sprockets-2.10.0
    Installing ri documentation for sprockets-2.10.0
    Parsing documentation for sprockets-rails-2.0.0
    Installing ri documentation for sprockets-rails-2.0.0
    Parsing documentation for rails-4.0.0
    unable to convert "\x89" from ASCII-8BIT to UTF-8 for guides/assets/images/belongs_to.png, skipping
    [snip]
    unable to convert "\xFF" from ASCII-8BIT to UTF-8 for guides/assets/images/vijaydev.jpg, skipping
    Installing ri documentation for rails-4.0.0
    28 gems installed
    
      * To start using RVM you need to run `source /Users/aka/.rvm/scripts/rvm`
        in all your open shell windows, in rare cases you need to reopen all shell windows.
    
      * To start using rails you need to run `rails new `.
    $ 
    
    Make sure the latest versions of RVM, Ruby and Rails were installed.
    $ type rvm | head -1
    rvm is a function
    $ rvm -v
    
    rvm 1.21.18 (stable) by Wayne E. Seguin , Michal Papis  [https://rvm.io/]
    
    $ ruby -v
    ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.3.0]
    $ rails -v
    Rails 4.0.0
    $ brew doctor
    Your system is ready to brew.
    $ 
    

Good! But this is a long way, isn't this?

2013年8月6日火曜日

Try ruby

Tried "try ruby".
  • This is an in-browser tutorial, which requires nothing but a web browser to try ruby. Obviously, this is something any computer language evangelist should do if he or she is serious about disseminating the language.
  • Tutorial commands on ruby prompt may be a bit confusing or misleading for ruby newbies. Because those commands must be methods of the main object but it's hard for newbies to understand the difference between the methods and variables.
  • "Methods. You've used English-language methods like reverse and symbolic methods like * (the multiplication method.) Methods are actions!" I think this sentence explains nothing. It contains abstract terms such as methods, symbolic, actions, and tell nothing about them. IMHO, following version is much better: "Methods. You've used word-like methods such as reverse and arithmetic-letter-like methods such as *. Methods are methods to make something happen."
  • Explaining [] as a scope to target something sounds good.
  • I quit this tutorial at #6. It's boring.

2013年8月5日月曜日

Restarting

I've been learning English for this two years, which has been consuming almost all my learning time. Consequently, I had no time to self-study computer science. That's why I stopped updating this blog.

However, I think my English writing skill has finally reached such a level that it enables me to learn computer science in English, I mean, with writing about it only in English. If I successfully achieve writing all blog entries from now in English, that will be also a great practice to learn English for sure.

Recently I was seeking a theme appropriate for the restart, and today I came up with an idea that Ruby is the best option for me currently.

I would like to start from the official documentation, <http://www.ruby-lang.org/en/documentation/>.