Sunday, November 29, 2009

Photo retouching...

The following video shows a technique I used to remove some distracting elements from the original shots of this album.

Sunday, November 22, 2009

How to enable Ruby debug in RubyMine 2.0 on Windows

I recently had the chance to evaluate JetBrains' RubyMine. I was well impressed by this IDE except for the impossibility to debug Ruby code.
However I didn't gave up and, googling a bit, I found a thread inside JetBrains Developer Community that helped me to fix my installation and finally to debug Ruby code inside RubyMine.
Although the entire procedure is fully described in that thread, I think is worth summarizing the fundamental steps to fix the environment.
Let's start from a scenario where Ruby 1.9 has been installed with the one-click installer and RubyMine 2.0 has been installed too. (If you installed Ruby with the zip binary, reinstall it using the one-click installer as found here. That's because currently the ruby debugger ide only works on Windows using a RubyInstaller installation). Also verify that Ruby's root path doesn't include spaces.
  1. Download Ruby DevKit. (The links brings you to a .7z file, that you can open with 7Zip).
  2. Open the .7z file and follow the instructions in INSTALL file: basically they said to extract top-level folders (i.e. bin and devkit) to the Ruby's root folder and to modify the contents of fstab file according to your installation. In my case, my Ruby folder was: C:\programmi\ruby19, so my fstab file contents became:
    C:\Programmi\Ruby19\devkit\gcc\3.4.5\mingw32 /mingw
    C:\Programmi\Ruby19\devkit\msys\1.0.11\usr\local /usr/local
  3. Execute the command gem install ruby-debug-ide19
    (Note that's fundamental to install ruby debug ide as ruby-debug-ide19 because RubyMine looks for a gem with name ruby-debug-ide19 and not ruby-debug-ide, as you would expect). Also be patient because the command takes a while to complete.
  4. Open with a text editor the file command.rb that's part of the installed ruby-debug-ide19 gem. In my case, that file was under folder C:\Programmi\Ruby19\lib\ruby\gems\1.9.1\gems\ruby-debug-ide19-0.4.12\lib\ruby-debug
  5. Modify the beginning of procedure debug_eval (at line 120) so to enter a new statement between statements str = str.to_s and max_time = 10. The new statement to enter is:
    return "" if str == "$FILENAME"

    At the end, the procedure debug_eval should begin like this:
    def debug_eval(str, b = get_binding)
      begin str = str.to_s
      return "" if str == "$FILENAME"
      max_time = 10
      to_inspect = str.gsub(/\\n/, "\n")
  6. Save the file
That's it. Enjoy Ruby debugging with RubyMine!

Friday, November 13, 2009

How to install the current Flash player into Chrome Portable/Firefox Portable on Windows

  1. Download the current Flash Player as xpi package from http://fpdownload.macromedia.com/get/flashplayer/xpi/current/flashplayer-win.xpi
  2. Rename the package's extension from .xpi to .zip
  3. Open the zip package and extract files flashplayer.xpt and NPSWF32.dll.
  4. For Chrome Portable: put extracted files into folder Chrome\plugins
  5. For Firefox Portable: put extracted files into folder App\Firefox\plugins
The current Flash player has now been installed into your portable browser. Let's verify the correctness of the installation.
  1. (Re)start your browser
  2. Type about:plugins in the address bar
  3. A list of installed plugins appears. Verify that Shockwave Flash is present and that there is an entry with MIME type application/x-shockwave-flash and suffix swf.
To check what's the version of the installed Flash player, open the page with URL http://kb2.adobe.com/cps/155/tn_15507.html