Sunday, September 16, 2007

日本語の勉強1

時間について:

や否や: 雨がやむや否や、彼は外に出た。        基本型

と: 梅雨時になると、雨が多くなる。             基本型

や: 兄はベッドに入るや、眠ってしまった。         基本型

が早いか: ホームで待っていた乗客は、ドアが開くが早いかどっと乗り込んだ。 基本型

なり: 朝起きるなり、顔を洗わないで、畑へ出かけた。   基本型

    あの本は買ったなり、まだ読んでいない。  連用型+た

そばから: 稼ぐそばから使ってしまう。  連体型。

がてら: デパートへ行きがてら、郵便局に寄って手紙を出した。      連用型

      散歩がてら雑誌を買ってきた。     動詞性名詞

                               主語は同じべき。

ついでに: ついでに、これを捨ててきてちょうだい。

かたがた: 遊びかたがた、故郷に帰ろうと思っている。   連用型         

        山へ避暑にいき、かたがた勉強する。

        お詫びかたがたお宅へお伺いしたいと存じます。   

                                       主語は同じべき。

かたわら: 学校で勉強するかたわら、アルバイトする。      連体型

        仕事のかたわら勉強する。                名詞

                                         主語は一つなくでもいいです。

ながら:   彼女が向こうから笑いながらやってきた。

てからというもの: そのことがあってからというもの、彼は日一日と落ち込んでいった。

てから:   お父さんがさっき帰宅してから、何も言わずに酒を飲んでいる。

を皮きりに: 彼が歌い出したのを皮切りに、みんな歌った。      体言

        そのひのパーティーを皮切りにして、みんなが毎月集まるようになった。

        これを皮切りとしていらいらな行事が行われる。

をきっかけに: 友人の結婚パーティーの出会いをきっかけに、彼女とつきあい始めた。

を限りに:  明日を限りにお酒をやめる。

        遠ざかる列車に向かって、「元気でなあ!」と、彼は声を限りに叫び続けた。

Saturday, September 15, 2007

Test Write Blog with Windows Live Writer

Just another test.

C++ Learning 3

A const reference can only call const member function.


void f(const Car& b) {


    b.GetName();   // ok


    b.StartEngine();// compile error


}


 


class Car {


    const char* GetName() const; // const member function


    void StartEngine();


}

C++ Learning 2

Typical usage of autoptr


typedef auto_ptr<TypeName> TypeNamePtr;


TypeNamePtr func1() {


    TypeNamePtr p(new TypeName());


    return p;


}


 


void func2() {


    TypeNamePtr p = func1();


    p.DoSth();


}


And if without auto_ptr, func2 should delete p finally, but now we just ignore this step, it


will be automatically released.

Friday, September 14, 2007

C++ tricks

void g()
{
  Car a;                                            
  Car b();                                          
}


a is an object,


b is not , it is a method declaration.

How to hide a form instead of closing it - with C# .Net

http://geekswithblogs.net/TimH/archive/2007/09/13/115323.aspx



// Use this event handler for the FormClosing event.

private void MyForm_FormClosing(object sender, FormClosingEventArgs e)
{
  this.Hide();
  e.Cancel = true; // this cancels the close event.
}

Thursday, September 13, 2007

C++ FAQ is a good book

I’m not very familiar with C++, and a lot of C++ tricks in there, and I can always get


help from C++ FAQ, it is great.


1) I learn the const usage


2) I understand the private inheritance and protected inheritance and composition’s differences 


 

Testing BlogJet

Just a test.