20091214

Cycle Mode 2009

I went to Cycle Mode 2009, a biggest bicycle exhibition, like a motor show, at Makuhari Messe.
(I forgot to bring my camera...)
I test-rode a few bikes: a few rode bikes, a recumbent, and a battery bike.

Now that bicycle is very in fashion, there are so many visitors that sometimes I have to wait for tens of minutes for a ride. What I newly know today is that Bridgestone established their brand, anchor, and Daisuke Imanaka, the first ever Tour-de-France Japanese rider, founded his new trading company Interfax to introduce really nice bikes and parts to Japanese riders.
I hope Japan will become nice country for cyclists and recover Japanese self-sufficiency ratio of bicycle.

Ostrich presenter demonstrated how to disassemble a bike and put the parts into a carry bag (輪行袋). It was easier than I imagined. I'm sure I will buy a bag. I might also buy a helmet; OGK's helmet is designed for Japanese.

Those who I went with were far more knowledgeable and interested in bikes. They said they would come to the show again.

After that I had Japanese sake with them. I like Denshu (田酒) for its standard taste.
Dassai 23% (獺祭 磨き二割三分) was super rich.
I thank them for inviting me for the show and drinking!

20091210

Table Event Handler

I made a code to handle button events and click event to edit the contents set to an SWT TableViewer. Sadly, however, my code was not adapted to my project officially.
I would like to put it here after generalizing confidential parts.

All you have to do is to create your own inherited handler by overriding newTableElement() and editTableElement() methods and set the table and the buttons to your handler.



package com.example.dialog.handler;

import java.util.ArrayList;
import java.util.List;

import metamodeling.generic.kernel.UMLNamedElement;
import metamodeling.generic.kernel.UMLNamespace;

import org.eclipse.emf.common.util.EList;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Shell;

public abstract class TableEventHandler {

   private Button        newButton;
   private Button        editButton;
   private Button        removeButton;
   private Button        upButton;
   private Button        downButton;
   IStructuredSelection  selection;
   TableViewer           viewer;
   List<Integer>         indexes = new ArrayList<Integer>();

   public void setNewButton(Button newButton) {
       this.newButton = newButton;
       this.newButton.addSelectionListener(new SelectionAdapter() {
           public void widgetSelected(SelectionEvent e) {
               newTableElement();
           }
       });
   }

   public void setEditButton(Button editButton) {
       this.editButton = editButton;
       this.editButton.addSelectionListener(new SelectionAdapter() {
           public void widgetSelected(SelectionEvent e) {
               editTableElement();
           }
       });
   }

   public void setRemoveButton(Button removeButton) {
       this.removeButton = removeButton;
       this.removeButton.addSelectionListener(new SelectionAdapter() {
           public void widgetSelected(SelectionEvent e) {
               removeTableElement();
           }
       });
   }

   public void setUpButton(Button upButton) {
       this.upButton = upButton;
       this.upButton.addSelectionListener(new SelectionAdapter() {
           public void widgetSelected(SelectionEvent e) {
               for (int i = 0; i <= indexes.size() - 1; i++) {
                   getElements().move(indexes.get(i) - 1, indexes.get(i));
               }
               viewer.setSelection(selection, true);
           }
       });
   }

   public void setDownButton(Button downButton) {
       this.downButton = downButton;
       this.downButton.addSelectionListener(new SelectionAdapter() {
           public void widgetSelected(SelectionEvent e) {
               for (int i = indexes.size() - 1; i >= 0; i--) {
                   getElements().move(indexes.get(i) + 1, indexes.get(i));
               }
               viewer.setSelection(selection, true);
           }
       });
   }

   private EList<UMLNamedElement> getElements() {
       return ((UMLNamespace) viewer.getInput()).getTheContainedElements();

   }

   public void setViewer(TableViewer viewer) {
       this.viewer = viewer;
       viewer.addSelectionChangedListener(new ISelectionChangedListener() {

           public void selectionChanged(SelectionChangedEvent event) {
               if (event.getSelection() instanceof IStructuredSelection) {
                   selection = (IStructuredSelection) event.getSelection();
                   if (selection.size() < 1) {
                       if (editButton != null)
                           editButton.setEnabled(false);
                       if (removeButton != null)
                           removeButton.setEnabled(false);
                       if (upButton != null)
                           upButton.setEnabled(false);
                       if (downButton != null)
                           downButton.setEnabled(false);
                   } else {
                       if (upButton != null && downButton != null) {
                           indexes.clear();
                           for (Object each : selection.toList()) {
                               indexes.add(getElements().indexOf(each));
                           }

                           if (indexes.get(0) > 0) {
                               upButton.setEnabled(true);
                           } else {
                               upButton.setEnabled(false);
                           }
                           if (indexes.get(indexes.size() - 1) < getElements()
                                   .size() - 1) {
                               downButton.setEnabled(true);
                           } else {
                               downButton.setEnabled(false);
                           }
                       }

                       if (selection.size() == 1) {
                           if (editButton != null)
                               editButton.setEnabled(true);
                           if (removeButton != null)
                               removeButton.setEnabled(true);
                       } else if (selection.size() > 1) {
                           if (editButton != null)
                               editButton.setEnabled(false);
                           if (removeButton != null)
                               removeButton.setEnabled(false);
                       }
                   }
               }
           }
       });

       viewer.addDoubleClickListener(new IDoubleClickListener() {

           public void doubleClick(DoubleClickEvent event) {
               if (event.getSelection() instanceof IStructuredSelection) {
                   selection = (IStructuredSelection) event.getSelection();
                   editTableElement();
               }
           }
       });
   }

   protected Object getFirstSelectedElement() {
       return selection.getFirstElement();
   }

   protected abstract void newTableElement();

   protected abstract void editTableElement();

   protected void removeTableElement() {
           getElements().remove(getFirstSelectedElement());
   }
}

20091202

My Girl (2)

After a little investigation, I know that the composer of the song "My Girl" respects KAN very much.
http://www.tadashinya.com/profile.html

I guess that's why the melody makes me feel nice.

20091130

My Girl

Very nice song!
In my opinion, the consonant-emphasized vocal rhythm is originated by Kazutoshi Sakurai (桜井和寿), who is truly genius. I like this rhythm.
It's after I sang along with the subtitle that I know it's a song for his important person who passed away. I hope they (嵐) will sing this song in Kohaku (紅白) :)
http://www.youtube.com/watch?v=fxQM6ywiJa4

20091129

So Many Typos

It's a menu of a buffet at the top of Mt. Mitake.


20091128

Mt. Mitake

I went hiking at Mt. Mitake (御岳山) for the first time.

Leaves are not red in city of Tokyo yet now; a few had red leaves and the others didn't have leaves already in this highland.

I visited Musashimitake-jinja Shrine (武蔵御岳神社). They say the name "Musashi" is derived from the legend that Yamatotakeru (日本武尊) built a warehouse (蔵) of his weapon (武) at the top of this mountain when he conquered the east of Japan. This mountain has been a spiritual center of Musashi region since that age.

After visiting the shrine, I enjoyed hiking around Rock Garden area.

Ayahironotaki waterfall (綾広の滝)


Rock Garden was very healing with the harmony of mossy rocks and clear water of upstream. I like it very much. I enjoyed sightseeing and trekking so much today.

20091123

Newly Translated Books on Music Theory

I went to Maruzen (one of the largest book stores in Japan), where I found
a few attractive newly translated books at a music book section.
http://www.amazon.co.jp/ピストン-対位法-分析と学習-ウォルター・ピストン/dp/4276105641/
and
http://www.amazon.co.jp/ピストン-デヴォート和声法―分析と実習-ウォルター/dp/4276103215/
They seem nice to me because they proceed explanations by referring to real works by great classical composers instead of using mechanical (boring) examples.
When I learned chord theory, I naturally made it by playing many Japanese pop songs by guitar.
Similarly, I should learn harmony and counterpoint by real works which I like.
Now I like all Invention works by Bach. I would like to appreciate them deeply using these books.

At the store, I also find this book but didn't buy it neither. I had only 2,000 yen at the time :P

[references]
One pity thing is there are too few translations for Japanese.
The Three Books by Piston
Harmony (Walter Piston)
Counterpoint (Walter Piston)
Orchestration (Walter Piston)
Schoenberg Books
Theory of Harmony (Arnold Schoenberg)
Fundamentals of Musical Composition (Arnold Schoenberg)
Other
Counterpoint (Kent Kennan)
At a glance, the last one seems very nice; it cites a lot from Inventions.

20091122

Cooked Tomato Spaghetti for the First Time

Cut three tomatoes and put directly into a pan.
Boil with minced onion and garlic.

After that, I fried a minced chicken with olive oil and finally mixed them with boiled spaghetti.

I cooked without checking recipe so much so I was sure it's not yummy. But it was not so bad than it looks:) Probably tomato ketchup I put at last helped me a lot...

Ideally, I should have put to something green, like Italian parsley.

20091121

Explanation Skill

They are ready-at-hand five tips from what I'm studying through this book.

1. Speaker's Request and Listener's Benefit

   +--------------------+
   |Intention of Speaker|
   +--------------------+
             V
   +--------------------+  +-------------------+
   | Action to Request  |<-| Scientific Ground |
   +--------------------+  +-------------------+
             V
   +--------------------+
   | Benefit/Disbenefit |
   +--------------------+

   Listener is motivated by benefit/disbenefit, not by scientific ground.

2. Goal, Challenge and Problem 
                       +-------+   +--------+
                     +-|Problem|---|Solution|
         +---------+ | +-------+   +--------+
       +-|  Issue  |-+
       | +---------+ | +-------+   +--------+
       |             +-|Problem|---|Solution|
+----+ |               +-------+   +--------+
|Goal|-+
+----+ |               +-------+   +--------+
       |             +-|Problem|---|Solution|
       | +---------+ | +-------+   +--------+
       +-|  Issue  |-+
         +---------+ | +-------+   +--------+
                     +-|Problem|---|Solution|
                       +-------+   +--------+
Issue  (課題): Something good to achieve
Problem(問題): Something bad which should not happen

3. Goal, Target and Policy

          +---------+   +---------+   +---------+   +------+
        +-|  Issue  |<--|  Issue  |<--|  Issue  |<--|Policy|
+----+  | +---------+   +---------+   +---------+   +------+
|Goal|<-+
+----+  |                                           +------+
        +-------------------------------------------|Policy|
                                                    +------+
Target(目標): (quantitative) target to achieve each challenge
Policy(手段): One of several ways to choose from to achieve a goal

4. 5W1H

Who
Why
Where
What
When
How
Whom
How much

5. Use, Function and Mechanism
   Three viewpoints usable when explaining a machine, or software.


When I wrote this, I found table-mode very useful.

20091120

This Is It

I watched the movie tonight. It's a movie but I felt as if I had enjoyed a concert.
He already had so much experience in a large scale performances and so talented in music that he could picture how each intention would work in the real live and he could make precise decisions about tempo, echo, and lighting effects, based on his own imagination. His all decisions were very understandable for me through the screen.
Despite his age, his vocal was still powerful and clear. The performance in "Billy Jean" was so amazing even though it was a rehearsal.
No one can tell how he feels now for not being able to make it happen and instead being prevailed through this documentary format, but one certain thing is that he has become a legend.

As he wanted to do so, he gave audience extraordinary experience.
I forgot things happened in my job and became happy tonight. Thank you, MJ!

20091117

Word 2003 XML and Eclipse Compilation Problems.

Today I processed one small customer support incident. I have to fix a MS Word document with too wide tables exceeding the paper width that is auto-generated using Word 2003 XML technology.
It was because the tables included too long words without any line break and occupied much space.
I found tag makes tables fixed-width and forcibly put such words within the width.
See http://msdn.microsoft.com/en-us/library/aa174899(office.11).aspx

It was easy until finding the solution and revising the source code. The following tasks of compiling it and generating its installer was unexpectedly troublesome.

At first I had to spend some time to configure JET.
[A Project] -> [New] -> [Other] -> [Java Emitter Templates] -> [Convert Projects to JET Projects]
[A Project] -> [properties] -> [Jet Setting] -> [Source Container]: gensrc
Secondary, I faced a version mismatch problem between eclipse subversive and client svn.
The project was checked out using subversive, which the build script is supported by another svn client program to write in a release version number.
The solution was written at http://subversion.tigris.org/faq.html#working-copy-format-change.
I had to downgrade some working copies I checked out using the latest subversive.
$ python change-svn-wc-format.py [working copy folder] 1.4
Very tricky! Even though subversion is so widely used, there are many different distributions which bother engineers around the world.

20091116

My Annual Study Plan

Being already bored with Dragon Quest IX, I guess it's time to organize what I have to and would like to study now.
(Declaring this kind of commitment in public is nice to force yourself to do something.)

  • Eclipse-related technologies: EMF (Eclipse Modeling Framework) is heavily related to my current work. I would like to study basically based on this book or it's original. Having no experience of developing a plug-in, I need to strengthen this knowledge at the same time. It's a long way to go. I hope this book will be a nice guidebook.
  • Junit: I borrowed a book titled Eclipseプラグイン開発 (translated from "Contributing to Eclipse") by a co-worker, to cover knowledge of so-called agile software development and extreme programming. Having an opportunity of developing an Eclipse plug-in, I would like to experience test-driven development using Junit at the same time.
  • Frameworks: During I was in Okinawa from 2005 to 2007, software development style had very changed powered by many open source standard frameworks: Struts, Spring, and OR Mappers. At first, I should understand the mechanism how each framework works. I think then I can easily comprehend each component of terasoluna and how it collaborates with the others. A training course I took in last week was very awakening. I think now I can remake an e-tendering system, which I have refined little by little in my Okinawan career, as pilot web system with Struts, Spring and Hibernate using Domain Modeling.
  • Architecture: I join a study meeting on domain-driven design (DDD). The initial reason I joined the meeting was to get connected with those respectable co-workers highly skilled in software architecture. We have been reading the book (now we are at around p.100) through the meeting. Discussion with the informed engineers is very stimulus. At the same time I'm reading Pattens of Enterprise Application Architecture (PoEAA) to know the position of Domain Modeling among the several patterns in more general point of view.
  • Non-technical skills: The second branch is perhaps rather the more important for me. When analyzing a software/refinement requirement, my thought often goes beyond my assigned issue and gets disordered, blur and I miss critical points. In a last meeting of some requirement analysis, when I was still considering a solution for a issue, the other members were waiting for me to move on because they knew the issue was already solved. Even though I thought I managed to get by only with my own way of thinking so far, I realize I badly need a skill of critical thinking. If I can organize and simplify my thought, I can be more productive because I can cut off time to think about unnecessary topics which are not expected by my stake holders.
What I wrote here requires me a lot of time and energy. But there's no turning back. I deleted an onigiri game, which is very addictive and have robbed me of enormous amount of time, from my PC. I would like to establish a schedule how to proceed. I would like to do them in parallel not to be bored with a single subject quickly.

    20091115

    Restarting Blog from Today!



    I had a dinner at a near-by French restaurant, MACHON. The main dish, a cocotte of cod and potato from Hokkaido (真だらと北海道産じゃがいものココット), was very yummy. The third picture is it.



    20090331

    Reached the target score in my TOEIC.

    Finally my TOEIC score reached the target I had set long time ago.
    I was so delighted when I found it!
    In fact my score didn't improved so much since last time, but the fact just reached the target itself is important for me. Now I temporary am having positive feeling when writing in English:)
    Soon after that, however, I lost my bicycle keys (very sad...) My hapiness didn't last long.

    20090328

    test

    this is my first blog in the blogger.
    how does it look like?

    Older posts are at http://www.tiquer.com/blog/.