Monday, May 31, 2010

QML sample using Webkit

QML can use Webkit because Qt 4.7 integrates it.
import Qt 4.7
import org.webkit 1.0

Rectangle {
    width: webView.width
    height: webView.height
    WebView {
        id: webView
        width: 640
        height: 480
        url: 'http://html5demos.com/canvas-grad'
    }
}

Of course, it is ready for HTML5.

Friday, May 28, 2010

Speakers of RubyKaigi2010 are revealed

2 days ago, all speakers are revealed in RubyKaigi2010 site (Japanese site).

Keynote Speakers

  • Yukihiro "Matz" Matsumoto
  • Chad Fowler
  • Jeremy Kemper

Speakers

(This is quick notification. we'll make an announcement of detail soon.)

okkez, Jake Scruggs, Shay Friedman, paulelliott, Kenta Murata, Hideki Miura, Yasuko Ohba, Tanaka Akira, Masatoshi SEKI, Carl Lerche, Toshiyuki Terashita, geemus, tenderlove, Paolo "Nusco" Perrotta, Alex Sharp, nari, Shugo Maeda, Yusuke Endoh, Jiang Wu, Munjal Budhabhatti And Sudhindra Rao, Sarah Allen, Sarah Mei, Yehuda Katz, Ted Han, Shin-ichiro OGAWA, Tom Lieber, Masahiro Tanaka, Hiroshi Yoshioka, SHIBATA Hiroshi, Makoto Kuwata, jugyo, Kazuhiro NISHIYAMA, Shintaro Kakutani, Satoshi Shiba, Tetsu Soh, ujihisa, Makoto Inoue, Masaki Yamada, Kouhei Sutou, Yuki Sonoda, Kei Hamanaka, Yuichi Saotome


At the same time, the RubyKaigi2010 team starts to call for "individual sponsors" (Japanese site).

Tuesday, May 25, 2010

Array in QML

In phosphorescence: Qt 4.7.0 Beta 1 and QtCreator 2.0 Beta 1 were released, I mentioned about a few big changes from TP1 to beta. But while coding QML, I found one change of specification.

For instance, in the last sample of phosphorescence: Mouse event on QML, transform property appears twice, but from Qt 4.7.0 beta, it is forbidden appearing transform property twice. So I rewrite this with QML array like below:

import Qt 4.7

Rectangle {
    width: 200
    height: 200
    Text {
        id: original
        x: 60
        y: 80
        text: qsTr("Hello World")
        MouseArea {
            /* inherit parent item area to handle click event
                because default area is none */
            anchors.fill: parent
            /* write acceptable buttons
                because there are no default button events*/
            acceptedButtons: Qt.LeftButton | Qt.RightButton
            onClicked: { // hooked event when mouse is clicked
                if (mouse.button == Qt.RightButton) {
                    parent.color = 'black';
                } else {
                    parent.color = 'red';
                }
            }
        }
    }
    Text {
        x: original.x
        y: original.y + 16
        text: original.text + "!"
        font {
            family: "Helvetica"
            pointSize: 12
            italic: true
        }
        color: "blue"
        transform: [Scale {
            xScale: 1.25
            yScale: 0.8
        }, Rotation {
            angle: 45
        }]
        smooth: true
    }
}

Saturday, May 22, 2010

QML editor's "Run settings" is improved

In phosphorescence: Qt 4.7.0 Beta 1 and QtCreator 2.0 Beta 1 were released, I mentioned about a few big changes from TP1 to beta. But while manipulating QtCreator, I found one more improved thing. It's "QML runtime argument" textbox.

In QtCreator 2.0 TP1, this textbox cannot accept translated message file, but from QtCreator 2.0 beta, can accept it. So we have not to launch with message file like phosphorescence: QML i18n, launch from QtCreator!

Thursday, May 20, 2010

Will WebM become a default video codec of HTML5?

At Google I/O, Google announced that VP8 turn to OSS 'WebM' and become the default video codec for some HTML5 browsers, e.g. Chrome, Firefox and Opera.

Will Qt Webkit be supported or not?

Monday, May 17, 2010

Qt 4.7.0 Beta 1 and QtCreator 2.0 Beta 1 were released

About 10 days ago, Qt 4.7.0 Beta 1 was released, And QtCreator 2.0 was also released.

The Biggest change for me of this release is there are already setted default_load_flags = FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH and have not to change this flag like this article.

I again show the installation of both products:

Download Qt 4.7.0 Beta 1
# tar -zxvf qt-everywhere-opensource-src-4.7.0-beta1.tar.gz
# cd qt-everywhere-opensource-src-4.7.0-beta1
# ./configure -declarative -optimized-qmake -nomake demos -nomake examples \
-no-qt3support -no-gtkstyle -system-sqlite -qt-sql-sqlite \
-opensource -prefix /opt/Qt-4.7.0
# gmake
# gmake install

Download QtCreator 2.0 Beta 1
# chmod +x qt-creator-linux-x86-opensource-2.0.0-beta1.bin
# ./qt-creator-linux-x86-opensource-2.0.0-beta1.bin

Friday, May 14, 2010

How to add facebook like button on each blogspot posts

Facebook social plugin was released. It's easy to add facebook like button on our whole site. But It's little difficult to add facebook like button on our each blog post. So I explain this approach for blogger/blogspot service.

  1. [Layout] -> [Edit HTML]
  2. Turn on the checkbox "Expand widget templates"
  3. Into the tag of class='post-header-line-n' or class='post-footer-line-n', put the snipet like below:
    <fb:like expr:href="data:post.url"/>
    <span id="fb-root"/>
    <script>
      window.fbAsyncInit = function() {
        FB.init({appId: 'your_app_id', status: true, cookie: true, xfbml: true});
      };
      (function() {
        var e = document.createElement('script');
        e.type = 'text/javascript';
        e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
        e.async = true;
        document.getElementById('fb-root').appendChild(e);
      }());
    </script>

That's OK!

Wednesday, May 12, 2010

RubyWorld Conference 2010 committee starts

In this Japanese news post, RubyWorld Conference 2010 committee starts and decide to hold in September 6 ~ 7, 2010 in Matsue city, Japan. These informations are not in Ruby Association's site, RubyWorld Conference's site and RubyWorld Conference's twitter.

Monday, May 10, 2010

I've finished reading "Design Patterns in Ruby"

I've finished reading Design Patterns in Ruby. And I found some leverage points for myself.

  • Both some class and its subclass can access same class variables. I did not know that.
  • This book contains one clear sample of coding Ruby's internal DSL.
  • Author encourages Meta-programming using method_missing like ActiveRecord's find_by_... method. But IMO I don't like it so as Meta-programming.

In conclusion, This book is having worth to read for every Rubyist (from experts to newbie).