27/11/2011

弟13課-復習B


I。
1)わたしはパソコン が欲しいです。
2)わたしは車が欲しいです。
3)わたしはお金が欲しいです。
4)わたしは彼女が欲しいです。
II.
  1. どんな車が欲しいですか。。。。ドイスの車が欲しいです。
  2. どんな靴が欲しいですか。。。。黒い靴が欲しいです。
  3. どんなパソコンが欲しいですか。。。。IMCのパソコンが欲しいです。
  4. どんなうちが欲しいですか。。。。広いうちが欲しいです。
III.
1)北海道へ行きたいです。
2)ビールを読みたいです。
3)映画を見たいです。
4)サッカをしたいです。
IV.
1)いつ北海道へ行きたいですか。。。。2月に行きたいです。
2)何を習いたいですか。。。。生け花を習いたいです。
3)だれに会いたいですか。。。。両親に会いたいです。
4)何を食べたいですか。。。。何も食べたくないです。
5)どんな本を読みたいですか。。。。旅行の本を読みたいです。
6)日曜日どこへ行きたいですか。。。。どこも行きたくないです。
V.
1)デパートへお土産を買いに行きます。
2)郵便局へ速達を出しに行きます。
3)図書館へ本を借りに行きます。
4)駅へ友達を迎えに行きます。
VI.
1)ホンコンへ買い物に行きます。
2)ホテルへ食事に行きます。
3)川へ釣りに行きます。
4)市役所へ外国人登録に行きます。
VII.
1)どこへ泳ぎに行きますか。。。。ホテルのプールへ泳ぎに行きます。
2)どこへお土産を買いに行きますか。。。。デパートへ買いに行きます。
3)どこへ絵を見に行きますか。。。。奈良の美術館へ見に行きます。
4)どこへ食事に行きますか。。。。インド料理のレストランへ食事に行きます。
VIII. 
  1. 何を買いに行きますか。。。。フィルムを買いにす行きます。
  2. だれに会いに行きますか。。。。カリナさんに会いに行きます。
  3. 何時ごろ子どもを迎えに行きますか。。。。2時ごろ迎えに行きます。
  4. だれとテニスに行きますか。。。。会社の人に行きます。

弟12課-復習B

I.
1)先月は忙しかったです。
2)お祭りは楽しかったです。
3)去年の冬は暖かかったです。
4)公園は人が多かったです。 
II.
  1. おとといは雨でした。
  2. 図書館は休みでした。
  3. 先週は暇でした。
  4. 奈良公園は静かでした。 
    III.
  1. 歌舞伎はおもしろかったですか。。。。はい、おもしろかったです。 
  2. コンサートはよかったですか。。。。。いいえ、あもりよくなかったです。
  3. お祭りはにぎやかでしたか。。。。はい、とてもにぎやかでした。
  4. 試験は簡単でしたか。。。。いいえ、かんたんじゃありませんでした。
IV.
  1. 天気はどうでしたか。。。。曇りでした。
  2. タイ料理はどうでしたか。。。辛かったです。
  3. 北海道はどうでしたか。。。あもり寒くなかったです。
  4. ホテルの部屋はどうでしたか。。。とてもすてきでした。
V.
  1. このかばんはそのかばんよりならいです。
  2. ホンコンはシンガポールより近いです。
  3. 地下鉄は車より早いです。
  4. ミラーさんはサントスさんよりテニスが上手です。 
    VI.
  1. コーヒーと紅茶とどちらがいいですか。。。コーヒーのほうがいいです。
  2. 大きいみかんと小さいみかんとどちらが甘いですか。。。小さいみかんのほうが甘いです。
  3. お父さんとお母さんとどちらが料理が上手ですか。。。父のほうが料理が上手です。
  4. 春と秋とどちらが好きですか。。。どちらも好きです。
VII.
  1. スポーツで何がいちばんおもしろいですか。。。サッカーがいちばんおもしろいです。
  2. 年でいつ(何月)がいちばん暑いですか。。。8月がいちばん暑いです。
  3. 家族でだれが歌がいちばん上手ですか。。。妹が歌がいちばん上手です。
  4. ヨーロッパでどこがいちばんよかったですか。。。スイスがいちばんよかったです。

12/11/2011

How to exit program from iOS application

From iOS 4.0 when you push Home button the application go to background instead of exiting as before.

 When you launch application again you can see the screen before the application go to background.
Sometime, you don't want this default behavior, you want to exit (terminate) the program when user press on (touch on) a button. How to do this?
There are two ways:
+ Call exit(0) in the action handler method.
+Call [[NSThread mainThread] exit] in the action handler method.

03/11/2011

Determin mp4 file is audio file or video file

If you receive mp4 file from server, you can determin it is audio file or video file by mime information which is sent by server. However, if mp4 file is in your Android terminal (internal or external storage device), how do you solve the problem? In this small post, I present a solution use MP4Parser library.

try{
//mp4 is path string of your mp4 file   

IsoBufferWrapper isoBufferWrapper = new IsoBufferWrapper(new File(mp4));
IsoFile isoFile = new IsoFile(isoBufferWrapper);
isoFile.parse();
//Get FileTypeBox   
    ArrayList boxes =( ArrayList) isoFile.getBoxes(FileTypeBox.class);
    FileTypeBox ftb =(FileTypeBox) boxes.get(0);
    String major =ftb.getMajorBrand().trim().toLowerCase();
    //The list of ftyps http://www.ftyps.com/
    if(major.equals("m4a") || //Apple iTunes AAC-LC (.M4A) Audio
       major.equals("msnv")|| //MPEG-4 (.MP4) for SonyPSP
       major.equals("ndas")|| //MP4 v2 [ISO 14496-14] Nero Digital AAC Audio
       major.equals("da1a")|| //DMB MAF audio with ER-BSAC audio, JPG/PNG/MNG images
       major.equals("f4a")|| //Audio for Adobe Flash Player 9+ (.F4A)
       major.equals("f4b")|| //Audio Book for Adobe Flash Player 9+ (.F4B)
       major.equals("m4b")|| //Apple iTunes AAC-LC (.M4B) Audio Book
       major.equals("m4p")|| //Apple iTunes AAC-LC (.M4P) AES Protected Audio
       major.equals("bsac")|| //MPEG-4 "Bit Sliced Arithmetic Coding" (audio)
       major.equals("mot slides") //Digital Audio Broadcasting (DAB) MOT slideshow (ETSI DAB  TR 101 497)
            ){
        //AUDIO FILE
    }else{
        //VIDEO FILE
    }
        }catch(IOException ex){
            ex.printStackTrace();
            //ERROR
        }

18/10/2011

Cuộc chiến giữa Android phone và iPhone ở khía cạnh nhà cung cấp dịch vụ

Sự lớn mạnh không ngừng của Android phone trong thị trường smart phone trong thời gian gần đây thật ấn tượng. Theo số liệu thống kê vào cuối quý 3 năm 2011, thị phần của Android phone là 43,7%.
Tuy nhiên hầu hết Android phone gắn kết với nhà cung cấp dịch vụ (carrier) Verizon trong khi iPhone lại chọn AT&T. Điểm khác biệt này đôi khi lại là nguyên nhân khiến người dùng chọn iPhone hơn Android phone.
Đọc thêm thông tin ở blog sau:
Jason Pearlow, Why my parents don't use Android