Libin Pan

One post at a time

Archive for the ‘English’ Category

RailsConf 2008

Stay tuned! More details about RailsConf 2008 will be here soon.

See you in Portland! :D

  • 1 Comment
  • Filed under: English, Ruby
  • Nearly 10000 dead in China quake, fears for many more

    China quake buries nearly 900 students in Sichuan Province

    Massive death toll feared in Chinese earthquake

    More on Google News

  • 0 Comments
  • Filed under: China, English
  • (Re)Enable TextMate Ruby Bundle

    We all love TextMate, by all means. It is the best friend for Ruby Developers.

    After our project upgraded to Rails 2.0+ at LearnHub.com, I noticed that there are some very powerful Ruby Bundle Commands just stopped working. Especially these two:

    • Run Focused Unit Test

    This is an awesome lovely command in Ruby Bundle, absolutely my favorite! It allows you to run a single unit test out of a whole suite of tests by simply positioning your cursor into the test you’d like to run.

    • Run Rake Task

    This is another cool command too. It shows a popup window which list all the available rake tasks you have and it will show a pretty HTML result window after you choose from the list.

    This thing really bothers me a lot. I could be fine for the second one, as I do have terminal windows open all the time. But I really really miss the first one, as our test files get longer very soon.

    I have to make it work!

    After couple of hours trying today, I’ve pretty much got the right reason and the simple solution, for now.

    The reason is that TextMate includes its own version of builder.rb, which is conflicting with Rails 2.0′ version of builder.rb.

    The simple solution:

    1. Open TextMate Bundlers Editor
    2. Find Ruby -> Run Focused Unit Test
    3. Search for RUBYLIB=”$TM_BUNDLE_SUPPORT/RakeMate${RUBYLIB:+:$RUBYLIB}”
    4. Change to RUBYLIB=”$TM_BUNDLE_SUPPORT/RakeMate”
    5. Reload Bundlers

    That’s it! And apply the same changing method to other commands such as “Run Rake Task” as well.

    And just want to point out the alternate solution is:

    mv /Applications/TextMate.app/Contents/SharedSupport/Support/lib/Builder.rb /Applications/TextMate.app/Contents/SharedSupport/Support/lib/Builder.rb.bak

    It’s up to you to choose one of them.

    Hope Google can pickup this post quickly so we can save somebody else sometime too. :)

    Enjoy!

  • 3 Comments
  • Filed under: English, Mac, Ruby, Software
  • Collect and share your online life


    My personal life and learning timeline.

    Collect and share your Learning life!

    Create yours on Dipity.com too.

  • 0 Comments
  • Filed under: English
  • ZipCar, Mini Cooper and Time

    Toronto, May 10, Sunny, 19°C. A beautiful day after the long long winter.

    There is a ZipCar parking spot in front of our building, I’ve been thinking to try them for a while. Finally, I’ve got my zipcard this Monday. So I decided to spend some time with this hot red mini cooper today. It was absolutely an exciting experience and I’ve learned three things:

    1. ZipCar is a great solution for occasional driving needs. Reliable and convenient access plus a reasonable price could make our life a little easier and more fun. You just reserve it early, drive it safe and return it on time. After that, you could just forget it until you need it again, so you don’t have to deal with those vampire insurance companies here in Ontario.
    2. Mini Cooper is an awesome car. It is beautiful, smart, powerful and big enough. The one I was driving is pretty much the same as the one in the picture. It has some very nice features such as sunroof. Driving mini is a really enjoyable and comfortable experience. I love this car and I am planing to get one when I really need. Well, maybe. If we could have ZENN electric car here?
    3. Time is money! (If you return ZipCar late, penalty starts from $50.) Your time is money, every second counts. Even some moments nobody pays you or you don’t pay anybody, they still are. So, if you don’t use it, you lose it, for even.

    Wanna give ZipCar a try too?

  • 0 Comments
  • Filed under: English, Toronto
  • Java SE 6 on Leopard, Officially!

    Half a year after Leopard has been released, we finally get an official Java SE 6 from Apple today!

    Java for Mac OS X 10.5 Update 1 adds support for Java SE 6

    Thanks Apple! Anyway…

    As you can see from the description:

    This update does not replace the existing installation of J2SE 5.0 or change the default version of Java.

    So if you want to make Java SE 6 your default version of Java, there is one thing you need to do:

    sudo ln….. OK, no command line this time.

    Here is the right way to do:

    1. Launch /Applications/Utilities/Java/Java\ Preferences.app
    2. Drag “Java SE 6 (64-bit)” to the top of the “Java Application runtime Setting”
    3. Save

    You could change Java Applet Runtime Version to J2SE 6 too, but please make sure you know you really need it.

    Enjoy!

  • 1 Comment
  • Filed under: Apple, English, Java, Mac, OS X
  • Nested Namespace in Rails 2.0

    $> mate config/routes.rb

    map.namespace :admin do |admin|
      admin.resources :user
    end

    $> rake routes

    admin_user_index GET    /admin/user
      {:controller=>'admin/user', :action=>'index'}
    ......
    

    $> mate config/routes.rb

    map.namespace :admin do |admin|
      admin.namespace :user do |user|
        user.resources :profile
      end
    end

    $> rake routes

    admin_user_profile_index GET    /admin/user/profile
      {:controller=>'admin/user/profile', :action=>'index'}
    ......
    

  • 0 Comments
  • Filed under: English, Ruby
  • links for 2008-03-31

  • 0 Comments
  • Filed under: English
  • UPDATE:

    Please see this page for the new version: Google AJAX Translation 0.2.0

    Google just released a new API yesterday: Google AJAX Language API.

    AJAX Language API is built on top of Google Translate, it current supports 13 languages and 29 translation pairs. It is new but it is already very powerful. If you want to know more about how to use it on your website, please see Google AJAX Language API Document for more details.

    We in Savvica want to use this cool technology in our awesome website: LearnHub.com. In the middle of doing this today, I was thinking about to enable this feature on my blog too. :)

    So, here we go, the Google AJAX Translation WordPress Plugin is arrived.

    Please download from here:

    http://wordpress.org/extend/plugins/google-ajax-translation/

    Installation is very simple:

    1. Download the plugin archive and expand it
    2. Put the ‘ajaxtranslate.php’ file into your wp-content/plugins/ directory, or put the ‘ajaxtranslation’ folder into your wp-content/plugins/ directory.
    3. Go to the Plugins page in your WordPress Administration area and click ‘Activate’ for Google AJAX Translation.
    4. Have fun with your blog readers.
    5. Please see my blog as an example

    Couple things still need to know:

    • Google Ajax Translate only allow 500 characters right now (March 2008)
    • So this plugin only supports translating the first 500 characters of your blog comments
    • In the current version(0.1), I only enable comment translation by default. There are two reasons for this:
      • Most of your posts are more than 500 characters, but most of your blog comments aren’t
      • Google will translate characters inside of html tags, which will mess your blog for sure
    • If you still want to use it with your post too, please comment out line 79 in ajatranslation.php
    • This is just an initial release, lots of feature will be added in. Please stay tuned.

    If you want to do some changes and glad to share with all of us, please feel free to comment here or send me email @ libin.pan at gmail dot com.

    I hope you will like it.

    Want to know more?

  • 43 Comments
  • Filed under: English, WordPress
  • First day in LearnHub

    Today is the day!

    It’s my first day in LearnHub. Pretty exciting! Time to have fun with Ruby on Rails fulltime!

    Here is our development team at March 17, 2008:

    Want to know more?

  • 0 Comments
  • Filed under: English, Ruby
  • Upcoming Events

    Pages