Monday, June 28, 2010

Nokia Qt SDK 1.0 and QtCreator 2.0 are finally released

As I mentioned in this article, Nokia Qt SDK 1.0 and QtCreator 2.0 have been released 5 days ago. This release is not enable building QML.

Friday, June 25, 2010

MacPorts and Ruby environments

Generally, The most easy way to install ruby on Mac OS is to use MacPorts. I read the installation guide, then I do 3 operations:

  1. Install "Xcode Developer Tools" from Mac OS X installation DVD
  2. Download MacPorts-1.9.1-10.6-SnowLeopard.dmg
  3. Install MacPorts from MacPorts-1.9.1-10.6-SnowLeopard.dmg

Then let's check the ruby environments MacPorts is managing.
$ sudo port list | grep lang/.*ruby
jruby                          @1.4.0          lang/jruby
ruby                           @1.8.7-p249     lang/ruby
ruby186                        @1.8.6-p388     lang/ruby186
ruby19                         @1.9.1-p378     lang/ruby19

As you see, Ruby 1.8.6, 1.8.7 and 1.9.1 are up to date. But 1.9.2 is not available, and JRuby is NOT 1.5.x.
I decide to install ruby 1.8.7, ruby 1.9.1 and JRuby 1.4.0.
$ sudo port install ruby
$ sudo port install ruby19
$ sudo port install jruby

Tuesday, June 22, 2010

I bought a Macmini, and the first thing I had to inquire...

I bought a Macmini (Snow Leopard 10.6.4). It's the first Mac OS machine to me. So there are some different UXs with Linux or Windows. The first goal to me is to use ruby 1.9 on my Mac. But the first thing I had to inquire is ... to take a screen shot! It's the most different thing with Linux or Windows. I found this approach by google. I re-summarize 3 screenshot tips below:

  • [Command]+[Shift]+[3] takes a screenshot of entire desktop, and save the PNG file to desktop.

    If you press [control] at same time, output goes to clipbord(doesn't go to desktop).
  • [Command]+[Shift]+[4] takes a screenshot of rectangular portion with dragging crosshair cursor, and save the PNG file to desktop.

    If you press [control] at same time, output goes to clipbord(doesn't go to desktop).
  • {[Command]+[Shift]+[4] and spacebar} takes a screenshot of specific window with highlighting camera cursor, and save the PNG file to desktop.
    If you press [control] at same time, output goes to clipbord(doesn't go to desktop).

Well, I can finally begin to operate installing Ruby 1.9.

Saturday, June 19, 2010

re-check "begin-rescue-else-end" on your ruby environment

I found some bug report for JRuby in here (now fixed).

I copy and simplify this sample code like below:
def hoge
  puts 1
rescue Exception => e
  puts 2
  raise "shouldn't get here"
else
  puts 3
  raise "should raise out of the method"
end
begin
  puts RUBY_VERSION
  hoge
rescue => e
  puts e.message
end

Let's evaluate this on each ruby environment.

Thursday, June 17, 2010

NetBeans 6.9 has been released

NetBeans 6.9 FCS has been released. This "Ruby bundle installer" bundles JRuby 1.5.0 and FCS of Glassfish server 3.01.

Monday, June 14, 2010

Release schedule of Qt 4.7.0 has been changed

In five days ago, Qt community announced the change of release schedule of Qt 4.7.0 and its related products. According to this article, Qt 4.7.0 will be released during this summer. And QtCreator will be released at the same time, but its version is changed from 2.0 to 2.1. What's happened? See the matrix below:

Former release plan
QtQtCreator
Qt 4.6.xQtCreator 1.x
Qt 4.7.0QtCreator 2.0
Nokia Qt SDK
Nokia Qt SDK 1.0
↓  ↓  ↓
Current release plan
QtQtCreatorNokia Qt SDK
Qt 4.6.xQtCreator 1.x
Nokia Qt SDK 1.0(with QtCreator 2.0)
Qt 4.7.0QtCreator 2.1

And now, Nokia Qt SDK 1.0 RC and QtCreator 2.0 RC are available.

Friday, June 11, 2010

QML opacity

It's easy to change the opacity to child QML elements. It's only setting opacity property between 0(full transparency) to 1(full opacity).

import Qt 4.7
import org.webkit 1.0

Rectangle {
    width: webView.width
    height: webView.height
    Text {
        x: 300
        y: 200
        text: "hidden text"
        smooth: true
    }
    WebView {
        id: webView
        width: 640
        height: 480
        opacity: 0.5
        url: 'http://html5demos.com/canvas-grad'
    }
}

This sample(opacity is 0.5) seems like below:

And if opacity is 0, above sample seems like below:

Tuesday, June 8, 2010

Ruby 1.9.2 preview 3 is able on Windows using MinGW

As you see these article(#1, #2), installing ruby 1.9.1 on Windows using MinGW a little hurt. But in ruby 1.9.2 preview 3, there is all okay. You just do CMMI instructions on your MSYS terminal like below:

Youhei@3935-CF61 ~ $ tar -jxvf ruby-1.9.2-preview3.tar.bz2
Youhei@3935-CF61 ~ $ cd ruby-1.9.2-preview3
Youhei@3935-CF61 ~/ruby-1.9.2-preview3 $ ./configure --prefix=c:/ruby-1.9.1 --enable-shared
Youhei@3935-CF61 ~/ruby-1.9.2-preview3 $ make
Youhei@3935-CF61 ~/ruby-1.9.2-preview3 $ make install

Saturday, June 5, 2010

Ruby 1.9.2 preview 3 was released

One week ago, ruby 1.9.2 preview 3 was also released. So I download from here and install its package like this entry. Let's check.

>/opt/ruby-1.9.1/bin/ruby --version
ruby 1.9.2dev (2010-05-31 revision 28117) [i686-linux]

In ruby 1.9.2 preview 3, there are 2 notable changes. 1st, LD_LIBRARY_PATH never includes current directory. 2nd, Japanese encoding deals "emoji" for Japanese phone carriers, these are NOT equal with Unicode emoji.

Wednesday, June 2, 2010

State management for QML

In 2 samples(phosphorescence: Change the scale of QML text and phosphorescence: Rotate QML Text), I implement the change of QML element with transform property. And there is one another and more smart approach: using State elements.

1st, naming id for the element to manage states. 2nd, implement the event to change to one another state. 3rd, implement State elements. Each State element is a couple of state name and behavior. See the sample below:
import Qt 4.7

Rectangle {
    width: 200
    height: 200
    Text {
        id: message // naming this to manage states
        x: 60
        y: 80
        text: "changable"
        smooth: true
        states: [
            State {
                name: "right"
                PropertyChanges { target: message; color: "#0000FF"; font.pointSize: 12; font.italic: true }
            }, // couple of state:right and its behavior
            State {
                name: "left"
                PropertyChanges { target: message; color: "#000000"; font.pointSize: 10; font.italic: false }
            } // couple of state:left and its behavior
        ] // state elements
    }
    MouseArea {
        anchors.fill: parent
        acceptedButtons: Qt.LeftButton | Qt.RightButton
        onClicked: {
            if (mouse.button == Qt.RightButton) {
                message.state = "right"; // change the state to "right"
            } else {
                message.state = "left"; // change the state to "left"
            }
        }
    }
}

Let's launch, and click with right button.


And with left button.