Using “OR” in grep

To use “or” in grep, you can use “|” such as

cat /path/to/file | grep -E "aaa|bbb"

In this case I search a text file to find text including “aaa” or “bbb”.

Note that this doesn’t work:

cat /path/to/file | grep -E "aaa | bbb"

Whitespaces mustn’t be included before or after the “|”.

Install Qt Components for Desktop

There are not so many components for QML. To use buttons, tabs, windows etc, you need Qt Components for Desktop.

Qt Labs blog article says that you can install Qt Components for Desktop with “qmake && make install”. But it is too difficult to understand for newbies like me. I’ll explain how to install.

# My environment is Linux. On Windows and Mac, not same way can be used.

First, download Qt Components for Desktop.

Open this URL and “download master as tar.gz” to download latest version. Using January 24 2012 version is  also good choice. I succeeded with this version.

# Of course you can download via git instead. Execute “git clone git://gitorious.org/qt-components/desktop.git”

Extract the tar.gz file. This time, extracted directory will be named as “qt-components-desktop”

Move to “qt-components-desktop” directory and check the contents with ls.

$ > cd /home/phanect/Desktop/qt-components-desktop
$ > ls
components  desktop.pro  desktop.qmlproject  examples  Makefile  qmldesktopviewer  README  src

Next, let’s compile and install.

At fitst, we have to execute qmake command. You should use qmake included in QtSDK. I failed to install when I use qmake provided by linux distributer. (openSUSE)

Just execute following command.

/home/phanect/bin/QtSDK/Desktop/Qt/4.8.0/gcc/bin/qmake

# I’m using Qt 4.8.0.

And, execute make install. This make command should be installed from system repository.

make install

Then see /home/phanect/bin/QtSDK/Desktop/Qt/4.8.0/gcc/imports/QtDesktop/ and you can find various files.

Then, you can use various components.

import QtQuick 1.1
import QtDesktop 0.1

Rectangle {
width: 360
height: 360

Button {

}
}

Write “import QtDesktop 0.1″ to use components.

[翻訳] Windows版Calligra Suite – テスト版がリリースされました

※この記事はKDE NewsのCalligra Suite for Windows – Testing Version Releasedの日本語訳です。本記事についての一切の権利は独KDE e.V.が所有します。訳していないところとか、訳していても若干上から目線の表現になったりしてしまったところもありますが、ご勘弁を(^^;

CalligraKDE on Windowsのチームは、Calligra SuiteのWindowsインストーラーの最初のテスト版のリリースを発表します。そう、Windowsユーザーの皆さん、独自のインストーラーで、自分の使いやすいオペレーティングシステムの上にCalligraをインストールして、使用したり、テストの手伝いをすることができるようになりました。

Calligraは軽量で、フリーな、オープンソースのオフィス/クリエイティヴィティスイートで、表計算・文書処理・プレゼンテーション・プロジェクト管理・フローチャート・ディジタルペイント・ヴェクター画像のプログラムを含みます。Open Document Format(ODF)を採用しており、このプログラムを使って作成したファイルは他のオフィススイートでも開くことができます。一方、Microsoft Officeのファイル(.doc / .docx / .xls / .xlsx / .ppt / .pptxなど)の読み込みも、基本機能はサポートしています。

CalligraのマーケティングコーディネーターであるInge Wallinは、“私たちは長い間、Windowsユーザーにも同じように(KOffice/Calligraを)使ってもらいたいと考えてきました。Calligraプロジェクトはバイナリーをリリースしなかったので、KO GmbHがWindows向けに調整してビルドするために努力してくれたことを嬉しく思います。多くのユーザーがこのパッケージを試し、発見したバグを報告してくれることを期待します。”と述べています。

これは非常に実験的な、初期ベータ版であることに注意して下さい。重要な作業にはまだ使わないで下さい。 多くのCalligra開発者は日常的にLinuxを用いていますので、つまり私たちはWindowsユーザーに、改善すべきところを伝えてもらわなければ改善できないことをお忘れなく。バグやクラッシュがあるでしょう。bugs.kde.orgに報告して、全てのオペレーティングシステムにおける最高のオフィススイートの開発に協力して下さい。

幾つかの機能は、まだライブラリがWindowsに移植されていないために利用できないかもしれません。(例えば、Kritaのhigh bit depth colorモードのうちのいくつかなど)

これは初期段階の不安定版ですが、すでに勇気あるCalligraテスターによる作品があります。Examples include this very announcement and the beautiful artwork of Giovanny Arce using Krita on Windows and featured in the screenshot above.

KO GmbH (ビルドの作成とホスティング)、NLnet (資金調達の援助)、実質的にすべての作業を行ったStuart MD、そしてKDE-Winチームに大きな感謝を捧げます。It was a major effort, made easier by the surprising number of features that worked flawlessly “out of the box” due to the excellent QT and KDE Platform libraries Calligra is based on.

こちらから不安定版をダウンロードすることができます。

…楽しんでくださいね!

(注: このインストーラーはCalligra Suiteの全てのコンポーネント(訳注: 文書処理、表計算、プレゼン…など全て)を含みます。個別のアプリケーションインストーラーは現在開発中です。)

KO GmbHについて:
KO GmbHはオフィスドキュメントアプリケーション、特にOpen Document Format関連や、オフィスドキュメントフォーマットの変換などのサービスのコンサルティング及び開発を行う専門企業です。ドイツの企業ですが、開発者はヨーロッパ全体及びアメリカから雇用しています。

NLnetについて:
財団 “Stichting NLnet” は、ネットワークの研究と、インターネットテクノロジーの分野の開発を促進しています。NLnet foundationの定款には、”電子情報交換と、それに関連するものや、その目的に対して有益なものを広める”とあります。

Qt Developer Conference Tokyo 2011

I’ve been Qt Developer Conference Tokyo 2011(#qtdc_jp) at Akihabara UDX. I didn’t attend today’s GIS class to attend this event. :P It was so varuable today.

I exhibited KDE & Plasma Active with terucco, one of KDE JP members. Terucco brought his FreeBSD machine with KDE and I exhibited Plasma Active (… on VirtualBox on my netbook, not tablet)

And it was the first time to see @moguriso, @IoriAyane, @kenya888 offline.

After the exhibition and seminars, I took lightning talk about Plasma Active. I made a screencast of Plasma Active, and presented with it.
At least there were no critical problem, but I found some problem:

1. I modified video at last night, but I used old version by mistake.
I created it on my home computer and forgot to download it on my mobile PC, and @himamura kindly gave me his WiMAX access point so that I can download from my dropbox. But I forgot… Sorry, @himamura… I waste your kindness… OTL
Anyway, preparation should be done sooner.

2. Not attractive for people who are interested in their business
I’ve believed it must be interesting for audience to see the demo, and boring to just listen to my explanation only with the text-based slides. So I just showed 2 slides to tell “Plasma active is a tablet UI” and almost all explanation was with demo video.
However, audience come to QtDC to improve their business, so I should tell them it is useful for their business at first. I planned to explain that “it is supported by two German company and useful for your business” at the last slide, but I ran out of the time and couldn’t.
It is important to consider audience’s character and interest.

We had a party after the event, and after that, some Nokia staffs and exhibiters had another party.
Fortunately I had a seat by Lars Knoll, the chief maintainer of Qt. I talked with him and Daniel Kihnberg (Qt Ecosystem Director) a lot.
I asked him relationship between QML and C++. As I thought, it is different from e.g. relationship between HTML and PHP. When you develop application with Qt Quick, C++ is used to create QML element, and module. (I don’t know module in Qt yet, so I may misunderstand him.)

I also asked him for plans about file processing method for QML. He answered it is not planned yet.

We also talked about English. It is difficult for Japanese to improve/keep English skill because there are few opportunity to talk in English in Japan. I think Europeans are generally better at English than Japanese because people don’t need passport to go other EU countries, and Lars agreed. But for example, German (Lars is from Germany) don’t have so many opportunities to talk in English and most books and documents are translated to German. There seems similar problem.

Lars also told me that people use English usually in small countries like Norway and Sweden. For example, Movies are in English and there are only Norwegian subtitles. That’s good environment.

It was great day. I appreciate all Qt DevCon staff to give us such a interesting opportunity.

How to reduce dangerousness to walk using smartphone

In last Cognitive Psychology class, the professor told us why it is dangerous to walk using smartphone. I’m interested in UI, so I asked him how to reduce dangerousness.

One of the reason is: Because character size is generally smaller than legacy phone, users have to concentrate on the display.
I asked him suddenly, so he didn’t find out so many good way, but he gave me an idea that times of operation should be reduced. Then users have to concentrate on less.

He also gave me another idea: The machine analyze the movement of user’s eyes, and contents scroll automatically. There is already eye camera, so we can realize it if we don’t care heaviness of the machine, but it is the problem how to make it generally acceptable…

如何にスマートフォンのながら歩きの危険性を減らすか

スマートフォンのながらあるきは、画面に対して過剰な注意を向けすぎているから危なくなる、という話が認知心理学の授業であったので、それについて授業後に先生と話してみました。
スマートフォンはガラケーに比べて文字が小さいので、それがより多くの注意を画面に対して払わなければならない、というのが一つの理由だそうです。
さすがにいきなり話したので、先生もぱっとは思いつかなかったようでしたが、操作の回数を減らすことができれば、向ける注意が小さくなる、というアイディアをもらえました。
目の動きで画面が移動してくれるといいなぁ…というアイディアも。視線を取得するアイカメラなる装置は既にあるようなので、技術的には問題はないのですが、これをどう一般的に使えるかたちにするかが課題ですねぇ…

Plasma Workspaces 壁紙コンテスト

※この記事はKDE NewsのPlasma Workspaces Wallpaper Contestの日本語訳です。本記事についての一切の権利は独KDE e.V.が所有します。

KDE 4.8のリリースを控え、デフォルトのデスクトップの外観を変える時となりました。メジャーリリースが2回行われるたびに、フレッシュなスタイルを維持するため、Plasma Workspaceのメインの壁紙は変更されてきました。

今回、アーティストでOxygenのマスターであるNuno Pinheiro(以前の壁紙の多くは彼が作成)がコンテストを開催して、KDEコミュニティに対して新たな壁紙を求めるよう言っています。提出受付は12月4日までです。Nunoと、KDE コミュニティワーキンググループメンバーのIngo “neverendingo” Malchow と Lydia “Nightrose” Pintscherが審査員として提出作品を評価します。最大で3つまでの提出作品が選ばれます。審査員が気に入ったものがデフォルトの壁紙として使用されます。

挑戦しようと考えていて、最大のフリーなデスクトップ上に表示させたいと思っているのであれば、これはチャンスです。作品を送ってください!

提出

メールの件名を”wallpaper2011″にして(必須)12月4日までに、nuno@oxygen-icons.org まで、送付してください。

コンテストのルール

  • 壁紙のサイズは最小で1920×1200です。(これとは解像度や縦横比が異なるディスプレイ用があることが望ましい)
  • デフォルトとして選ばれた壁紙はLGPLでライセンスされている必要があります。
  • 写真も受理されます。
  • 壁紙はKDEの価値 – 優雅さ(Elegance)、自由、使いやすさ – を表す要素を含む必要があります。
  • 最優秀賞受賞者は、決定がなされた時に通知されます。

Text Background color in QML

On Text element of QML, there is no background color property. So you have to use Rectangle element.

Rectangle {
    color: "#808080"
    Text {
        text: "Hello, World"
    }
    width: childrenRect.width
    height: childrenRect.height
}

The result is…

Rename garbled file name

On Linux, when you extract compressed files created on Windows, (especially developed by Japanese) Japanese characters in file name are garbled. You can’t rename or delete them via file browser (like dolphin or nautilus) in usual way, so you have to rename it via command line.

First, move on to the directory which garbled file is included. In my case, files are included under /home/phanect/

$ > cd /home/phanect

Then, execute “ls” command with “-i”option.

$ > ls -i

294930 ???J?p?@archive??     294913 bin              286741 Download
319490 Documents             286820 Templates       303105 public_html
303106 Desktop

You can see numbers before the file name. This is named inode number. You can specify the file instead of the file name. This time, we want to delete “???J?p?@archive??” so we use “294930

Next, use find command.

$ > find /home/phanect -inum 294930

./???J?p?@archive??

With this command, you can get file name specified by inode number.
The first argument “/home/phanect” is the directory including garbled file.
And specify inode number with “-inum” option. 294930 is the inode number of garbled file in this case.

Can you see the file name which you want to rename?

Now, let’s rename it.
You can execute desired command to the file with find command.

$ > find  /home/phanect -inum 294930 -exec [command] \;

You can write command between “-exec” and “\;”

(“\;” means the end of the command. More details for Wikipedia.)

Well, in this case, you want to execute following command:

$ > mv ???J?p?@archive?? new_file_name.txt

But you can’t. (because file name is garbled)

So you have to execute:

$ > find  /home/phanect -inum 294930 -exec mv {} new_file_name.txt \;

{} means file name of “???J?p?@archive??”. In this case, file is not specified with file name but inode number, so renaming is safely done.

Where is applications list of Kickoff?

Applications list is saved at “/home/jrillet/.config/menus/applications-kmenuedit.menu”
This is an XML file.
This XML file is just a list. Only *.desktop file names are listed here.

The category (Internet, Graphics, Multimedia etc.) information files are under “/usr/share/desktop-directories/”.
The applications information files are under “/usr/share/applications/”
Note that KDE applications are under “/usr/share/applications/kde4″

Refferences:
How to edit Kickoff menu manually
KDE menu category associations – KDE Community Forums