2008-12-28

[Apache Derby] limit command




なんでかapache derbyでlimit文が使えないなぁ、と思ってたらサポートされてませんでした。 でも、ちゃんと代替の方法も用意されているみたいで、以下のように書いたらちゃんと動きました。
Statement stmt = con.createStatement();
stmt.setMaxRows(5);
ResultSet rs = stmt.executeQuery
    ("SELECT * FROM myLargeTable");

この"stmt.setMaxRows(5)"の部分が、"limit 5"になる模様。

参考サイト:
http://db.apache.org/derby/faq.html#limit

2008-12-17

[tango!]New Member and New Ideas


先週の情報検索の発表を見学したら、tango!に組み込むとなかなか面白い事が出来るんじゃないかと思える作品がいたので、そのメンバーの人たちを即勧誘しました。教授から受けたアドバイスの一つに、「有限のtangoを無限のtangoにする」というものがあったのですが、彼らの作品をうまく組み込むことができればアドバイスされたことが実現できそうです。実力あるメンバーも増えたし、プロジェクトの開発環境も整えたし、作業領域も明確化したし、面白くなりそうな予感。


2008-12-15

[tango!]Embedded Database in Eclipse


片手間にやっていたから、幾分か時間がかかってしまいましたが、ようやくApache Derbyを使った、はりぼてではないデータベースできました!

上図はコンソール上でのデバック用の出力です。ちゃんと出てる(気がします)。次のステップは、用意した20数万語のデータをデータベースに入力することかな。
さて、ではこの勢いで、大分後れを取っているTOFLE iBTの課題もちゃちゃっと終わらせます。
それでは。

2008-12-11

Lesson Review Tasks 1-10




These below are my answers for Lesson Review Tasks in Unit 1 through 10. If you will take the course "Tutorial English" at Waseda University, this might be useful to understand how much qualities get score high, because even these answers, which are not so good for answer, were graded the highest score. By the way, after looking over all the answers, I noticed that the quality of each answer deteriorates gradually, as time goes. Actually, it must be boring anyway because this task gives me no feedback from graders. Students would be glad, if graders would have given them comments, even very short comments, to each answer, I hope.



-Lesson Review Task 1 through 10-
[Unit 1]
1. Do you think this course will be helpful for you? Tell me your study plan for this month.
Yes, I think this course will be helpful for me for the following reason.Most importantly, this course will be helpful for me to practice the speaking section of TOEFL iBT. In Japan, where I live, we can easily self-study at other sections, which are Reading, Listening and Writing; however, I cannot easily self-study at the Speaking section because the section evaluates test-takers’ delivery, language use and topic development. Especially, delivery cannot self-study efficiently because it is an interaction, not self-action, so we should improve the skills through general communication, for example. Therefore, I strongly believe that this course, Tutorial English pre-advanced, will be so helpful for improving the required skills of the speaking section.2. What was your favorite subject in high school? (Use the AAA technique to answer this question.)
My favorite subject in high school is the Introduction Programming course because I was able to learn a lot of skills required for my current department, computer science. Specifically, the course helped me understand the object-oriented programming which is an important way of thinking when we make a computer program. Thanks to this previous knowledge, I was able to easily follow the courses in university. Do you have any subjects which helped you after graduating high school?



[Unit 2]
1. Are you confident about interrupting or changing the subject in English? Why or why not?
Yes, I am confident about interrupting or changing the subject in English because I learned a lot of useful phrases to do that from this Unit 2. For instance, when I would like to change a topic in English conversation, I only put in the phrases before the next topic I would like to talk, such as “By the way”, “It’s funny you should say that” and “Sorry to interrupt, but” Therefore, I have strongly confident about interrupting or changing the subject in English.2. Using the Language from Unit 2, write a mini conversation between you and a friend. Don't forget to change the subject once.
Friend: Hey, Yohei! Nice day, isn't it?Yohei: Yes, it’s pretty fine. What's new?Friend: Yes, I got surprising news, today.Friend: Did you hear that Chika is possibly on the dean's list at Waseda University?Yohei: Really! That’s great! I feel she currently studies so hard that she is able to score higher.Friend: By the way, did you also hear that Chika has a new boyfriend?Yohei: Wow! I did not know that, but perhaps, it might promote her intention to study.Friend: I think so too, because she seems really happy in both academic and private life.Yohei: Her boyfriend would be a very positive impact on her life. I have come up to want my girlfriend.Friend: Interesting, but you cannot choose Chika as a girlfriend, anyway.Yohei: That’s right.Yohei: Well, I have got to go because I have a class.Friend: Okay. See you later.



[Unit 3]
1. Why do you think there is an "English only" rule in the Tutorial English booths? Do you stay in the booth during the break? Why or why not?
Yes, I often stay in the booth and talk with classmates during the break, because it is a good opportunity for me to improve my speaking skills. Additionally, I think the rule “English only” is set up to help student’s future activities global. In Waseda University, although other departments might have many international students whom local students have to talk in English, the science and engineering department’s students are almost Japanese. Thereby, plenty of students in the science and engineering department only use Japanese. However, all the students have to require English skills if they will present their result of research, so they should make full use of opportunities that they are able to use English. To help such activities in the future, there is a rule “English only”, and I often stay in the booth during the break for preparing my own future activities.2. Using the Language from Unit 3, tell me about a memorable day you had in junior high school.
I vividly remember that a memorable day, when I had in junior high school, is the day to check the result whether I passed an entrance examination of high school or not. To score high at the exam, I was always preparing for the exam, when I was a third year student. Additionally, because I was on a basketball club, I was always so busy for three activities which are studying at school, the club activity after school, and preparing the exam to attend cram school in the evening. Needless to say, then daily life was not quiet, but I am pretty sure that continuing these three activities gave me a progress. However, because I was given only one chance to take the exam, I was very anxious, so I remember the day to check whether I passed or not, like it was yesterday. As a result, as I am here now, I was able to pass the exam of Waseda University High school, one of the most difficult private high schools to pass.



[Unit 4]1. Explain in detail what you should do to thoroughly prepare for each lesson. How much time should you spend to prepare?

In my opinion, we should do at least two preparations for each lesson. One is to skim the units which we will study in next class, and find out whether there are words we do not know, or not. Also, if we discover the word, we should check the word using dictionaries. Another one is to do something that the “preparation” section shows. These I showed above are the preparations, at least.

However, if we have enough time to prepare thoroughly, we should do two more extra preparations. One is to remember all phrases indicated by bold style in each can-do function, because it cuts the time to remember them in class. Thereby, we can use extra time to deeply understand each section. Another one is to understand what we will work with classmates. For example, if there is a role play section in units, the section or its similar section would be taken up. Preparing working with classmates, we would be able to make full use of discussion in class, because of needless to understand the role play section.

In conclusion, preparing four things I mentioned above, I strongly believe that we could maximize this class; also, even if we do not have enough time to prepare them, at least we should prepare two things I stated at the beginning, for each lesson.
2. Using the Language from Unit 4, agree or disagree with the following statement and state why: People should be able to smoke on the subway.

If you ask me, I disagree with the statement that people should be able to smoke on the subway for the following reason.

Most importantly, smoke made by the smoker makes additional tasks to employees of subway. To take an example, in 2000, I was a student at local junior high school, where there is a smoking room for teachers. Needless to say, there is a vent for smoke in the room, so we did not care about smoke. However, on January, we had an event to do the school cleaning, and then I was given the assignment to clean up the smoking room. In the room, there were almost no dusts or garbage which we should clear up, but a lot of tars were on the wall. The tars were difficult to wipe up, so I took plenty of times to finish my assignment. The way I see it, that difficult experience would cause in this case of subway; thereby, the employees’ work would increase because of the additional tasks.

In addition, remaining smoke on the subway has negative impact on other users who are sharing space with smokers. For example, when I was a sophomore in university, I went to the Shinsai-bashi in Osaka, Japan, where there was a long shopping mall under the ground. Although the shopping mall had good restaurants, souvenir shops and general stores, the shopping malls did not have a smoking room, but smoking area on the mall. As a result, I had to inhale smoke when I walked through around the smoking area, because the situation in underground kept smoke remaining from escaping to the ground. Thereby, it made me a little unpleasant, and in fact, there were no people without smokers around the smoking area. According to this example, this case occurs on the subway as well because the subway is also under the ground.

In conclusion, I argue that the statement that people should be able to smoke on the subway should not be allowed.
[Unit 5] 1. You have two Lesson Review Task questions to answer after each class. Why is it important to use the language from the lesson in the second question and answer both questions in detail?

The reason why answering two Lesson Review Tasks using the can-do function is important is that we are able to remind the can-do function we learned in class. Additionally, we can lay be remembered. For example, when students take class, instructors teach us new knowledge in each class, and they learn new things from class. However, most students run over the new things when final tests or reports are coming, because reminding new knowledge is very useful ways to remember longer and more deeply understand them. Therefore, they can score high in the tests or reports.

This example happens in this case, the class of Tutorial English. If we make useful of what we learned out of the class, we should remember longer and understand deeply them. Specifically, we should remind what we learned. As the functional way of reminding them, we have the task called Lesson Review Task. Therefore, answering questions asked by Lesson Review Task by using the can-do function is important.
2. I think I'm coming down with the flu. Using the Language from Unit 5, give me some medical advice.
In my opinion, if you would like to be feeling 100 percents, you should do three things. First, gargle with warm, salty water or mouth wash to protect your throat from bacteria. Second, put ice on your forehead and side to prevent from getting your condition worse. Third, stay home and rest with your body warming to help your body itself fight off the flu. I hope you will soon be up and about. Take care!


[Unit 6]1. Are you able to express your opinions in English more clearly now? Why or why not?
I am able to express what I think in English more clearly now because I learned how to express opinions from Unit 4, such as “The way I see it” and “As far as I am concerned”. Before I took the class of Unit 4, I state my opinion by saying a few common phrases, such as “I agree with” and “I disagree with” which”. Those phrases are certainly useful, but it cannot show how many percentages I agree or disagree. However, since I had learned other several useful phrases such as “I could not agree more”, I am able to how much I agree or disagree with matters. Therefore, I strongly believe that I am able to express my opinions in English more clearly now.
2. Using the Language from Unit 6, recommend something to do near Waseda University on a Saturday afternoon.

It depends on what you are a student or teacher now, but if so, I suggest you go to a gym in Gakusei Kaikan, which is near from Waseda University and opens even on weekends. Nearby Waseda University, there are other several gyms, but we have to pay about 5,000 yen per one month for registration, or pay about 500 yen per one time as a guest. In contrast, the gym I suggested cost just 2,000 yen per one year for registration, which is incredible reasonable. Therefore, why don’t you try to go to the gym?
[Unit 7] 1. What topics do you need to review from Units 1-6?
I think I need to review from Unit 4, Express Opinions and Agree and Disagree, because this unit has a lot of useful phrases to discuss with people. In my department, computer science, there are several opportunities which require discussion skills for senior students, such as classes whose teacher explains some technologies in English and video conferences which we must speak English to communicate other country’s students. Although I am not a senior but junior, it is clear that I will meet those opportunities many times in the future. In addition, I would express my opinions flexibly if I review this unit. For example, it reduces misunderstandings where I stand in discussion. Also, I would be able to disagree with other’s statement without giving too much negative impact. For these reasons, the phrases written in Unit 4 would be useful for my future activities. Therefore, if you ask me, I need to review from Unit 4.
2. Look over Units 1-6 and list some phrases or words that you feel will be useful and explain why.

As the same reason that I answered to a previous question, I feel these phrases listed up below will be useful for my future activities.

[Express opinions]
“The way I see it”, “As far as I’m concerned”, “If you ask me”, “My point is”, “I’d like to point out”, “Don’t you agree”, “Wouldn’t you say”

[Agreeing]
“I agree”, “Exactly”, “I couldn’t agree more”, “That’s just what I was thinking”, “I agree with the point you made about”, “You made a good point about”

[Disagreeing]
“Yes, that’s true, but”, “Maybe, but”, “I disagree”, “I don’t agree”
[Unit 8]
1. Do you think you will be using English in 20 years? Why or why not?
Yes, I believe that I will be using English in 20 years while I am in my field, computer science. There are 2 main reasons why I believe so. First, most of programming languages are composed of English, such as C and JAVA. Also, manuals of them are written in English. Even though there are some manuals written in Japanese, the amount of information they have is clearly lower than the manuals in English. Thus, while making a program, I will be using English even in 20 years. Second, most of famous conferences, contests and textbooks are used in English, so English skills are important tools to study at computer efficiently. In addition, in the field of science and engineering, having a board outlook is an essential element to conduct a research. If I do not have a broad outlook, I would research something which is already found by other researchers. Therefore, broadening my outlook, studying and using English to gather information is necessary. As I show the reasons above, I strongly believe that I will be using English in 20 years.
2. What job do you think your best friend would be suited for? Why? (Use the Language from Unit 8)

I believe that my best friend, Waseda Taro, would suit the researcher in the field of computer science, because he is quick study and efficient. In computer science, researchers are required not resourceful or eager beaver, but quick study and efficient. As is widely alleged, new computer technologies develop more quickly any other fields; consequently, researchers should always catch up with the new technologies in order to enhance or produce newer technologies. However, if researchers have to spend much time to learn them, they would lose their time to conduct their research. Therefore, researchers in computer science should be quick study and efficient. Getting back to the character of Waseda Taro, actually he is not so eager beaver and resourceful, but he is quick study and efficient, so I believe that he would find the job of a research in computer science.


[Unit 9]1. How do you remember new English words and phrases?
Many of my friends remember new English words and phrases using word list which English meanings are in left side, and Japanese meanings are in right side. They remember English words and phrases hiding each side of the list, and try to translate them in another side, such as translating a Japanese word into an English word. In my opinion, a lot of Japanese people remember English words and phrases in this way. For me, I do remember English not in the usual way, but in the new way that translates an image into English.

The new way is proposed by the some linguists, such as Onishi Taito and P.C.McVay who have master’s degree of linguistics in Oxford University. This new method is clearly simple that we do not remember new languages using translation from our own mother tongue, but remember them from images. According to what the linguists mention, the benefit of this way is that we remember something faster, and hardly forget it than we remember it using word list at least. To take a personal example, I was able to remember new English words and phrases certainly, and I hardly forget them, which is clearly more efficient for me to remember something.

Therefore, I remember new English words and phrases using image, not characters.
2.Using the Language from Unit 9, tell me what you think is the biggest problem facing university graduates today? What are some solutions?

If you ask me, the biggest problem facing university graduates is that makes the situation of finding a job more difficult, because of Economic Crisis, which approximately started from bankruptcy of Lehman Brothers Holding Inc. Fortunately, Japan did not have a credit obligation of subprime loan in USA so much; consequently, Japan are lightly affected from the crises, by comparing other countries such as Iceland. However, even in Japan, the crises certainly have a negative impact on Japanese companies, and students who will do job hunting in the future. For example, a student who will graduate at Meiji University, which is one of the famous universities in Japan, received a job offer letter from a banking company, and he did not have any problem to graduate the university. However, the company suddenly withdrew an employment offer and sent him 500,000 yen as a charge of firing. Subsequently, he had to find a new job, but it was difficult because he was not a fresh graduate. In Japan, not fresh graduates have difficulty in finding a job because they are usually considered that they have some problem to be fired. As this example above illustrates, the biggest problem facing university graduates today is that they are possibly hired in sudden, and it makes their situation to find a new job worse.



[Unit 10]1. What can you do to improve your non-verbal communication skills?

If you ask me, non-verbal communication skills would be improved significantly when people are in place where all languages they learned are not in effect. In the situation, people have to deeply consider at how to communicate other people with non-verbal communication skills, because they have no other tools to communicate. Subsequently, their non-verbal communication skills would be improved. However, for me, placing me in the situation is very difficult because Okubo-campus has no such a place. Instead, I suggest to improving the skills, making the situation by design, such as talking with my friend with no language but gesture and drawing something. In doing so, we would get the same effect as placing me in the situation.2. Your parent accused you of spending too much money on your hobby. Justify your reason(s) using the Language from Unit 10.

There is a good reason for it. You know, my hobby is building up a computer, so I thought I would surprise you with giving you my original computer which I am building up, which is more user-friendly, reasonably and sophisticatedly than other computers you can buy in shops. For this reason, I had to spend money.

2008-12-10

GWT+Eclipse with Cypal Studio+Apache Derby

合計7, 8時間ほど、無駄に悩みに悩み続けて、ようやくGoogle Web ToolkitにApache Derbyを実装させることに成功しました。だいぶ手こずりました。







分かったこと:
・Client -> Apache Derbyはできない。
・Server -> Apache Derbyはできる。



現状の問題点:
・エラー時の例外処理
・日本語の入出力方法
・Remote Moduleを使うと、Web上にアップロードできない



超お世話になったサイト:
http://www.ibm.com/developerworks/opensource/library/os-ad-gwt1/
http://www.fukudat.com/wiki/ja/Apache_Derby
http://allabout.co.jp/internet/java/closeup/CU20080911A/
http://allabout.co.jp/internet/java/closeup/CU20070119A/




まだ時間あるし、はりぼての実装だけ済ませてしまおうかな。

2008-12-09

GWTプロジェクトをDeployする方法

先日示したGoogle Group上でディスカッションした内容なんですが、もしかしたら他の誰かの役に立つかもしれないと思ったので、Blog上でも公表しておきます。


----- 以下、引用 -----
以下に、GWTで制作したプロジェクトをDeploy(ウェブ上で閲覧できる状態にすること)する手順を記します。

前提条件:
・Cypal Studioプラグインを導入したEclipseで、プロジェクトを制作している。
・TomCat ver 5.5 が、\Program Files以下にインストールされている。
※Tomcatのインストール方法は下記HPを参照してください。
http://www.site-cooler.com/java/tomcat/

1. 完成したプロジェクトをEclipse上で実行(run)する。

2. 上部ツールバーの右端にあるComple/Browseを押す。

3. ウェブブラウザが立ち上がり、ページが無事に表示できているかどうかを確認する。(更新すると直るバグも時々あります。)

4. Eclipseのウィンドウに戻り、プロジェクトのフォルダ階層の、一番上にあるプロジェクト名を右クリックする。

実行例:


5. "Export" -> WAR Fileを押し、適当な場所に出力する。

6. 出力したWARファイルを、"C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps"にコピーする。

7. 数秒後に、webappsフォルダ内に、"プロジェクト名"フォルダが生成される。

8. 生成されたフォルダをデスクトップにコピーする。

9. FTPアプリケーション(例えば、FFFTP)を使い、デスクトップにコピーされたファイルをアップロードする。

10. 無事にアップロード出来ていれば、アップロードされた先のURLにアクセスすることでGWTプロジェクトが表示できている。

以上です。

2008-12-06

tango! project open


今まで情報検索の実験として進めていたtango! projectですが、オープン化しました。というのは、今後の活動は、ただYahoo!で発表するためだけに開発を進めていくので、学業の成績とはもう関係がなくなり、ほぼ趣味の領域に入ると考えたからです。このため、少なくとも形だけでも、オープンに参加者を募ることにしました。

以下が、tango! projectの情報共有スペースです。
http://groups.google.co.jp/group/tango_project

興味のある方は連絡をば。現時点では、元々いたメンバーに加え、イギリスに留学してる友達と、デザインコンテストで賞をとったことがある後輩が、ウェブデザイナーとして参画してもらえることになっています。

個人的には、もう成績とは関係なくなるし、プログラミング言語の制約もなくなる(今まではJavaのみで記述)ので、大分気が楽になります。実際に、同じくYahoo!で発表するであろう友達は、これからは全てpythonで書くとか言ってました。

うん。OS制作のプロジェクトもあるので、tango!だけに傾注するわけにはいきませんが、なんか面白くなってきました。こういった気持ちを維持できるよう、出来ることから少しずつコツコツやっていきたいです。

2008-12-05

tango! feedback


睡眠時間って、結構なくても生きていけるもんなのか。いや、でもやっぱ6時間は寝ていたい。

ども、今日、先日投稿したウェブアプリケーションの発表が終わりました。もう片方の班の発表がまだだから、まだYahoo!で発表できるかどうかはわからないけど、少なくとも観客とTAと教授の関心度を見る限りでは、現時点で1位 or 2位なはず。というのも、親しい友達の班の発想が結構面白くて、プログラムの難易度ではこっちが勝ってると思うけど、アイデア面では負けてる気がする。いや、でも本当にアイデアは面白かった。流石だ。

来週にもう一方の班の発表あるけど、色々と面白そうだから見学しようかな。

補足:
tango!の今後を妄想してみる。
-ガジェット化して、Google Desktopのサイドバーでtango!が動いているとか。
→思想の飛躍は常日頃から。

-新しい単語とその情報を何らかの方法で取得し、有限のデータを無限のデータに。
→検索ワードを取得するAPIを使ったりとか。

-tango!の状態遷移図の中に、ゲーム状態を追加する。
→単語当てゲーム?意味当てゲーム?

-Apatch Derbyを使って、堅牢かつ軽快に動くデータベースを構築。
→これは必須かな。

2008-12-04

Tango!




明日発表のウェブアプリケーション「Tango!」のβバージョンをリリースしました。

βバージョンでは、"あ"~"え"の単語しか拾えません。また、Apache Derbyを使わずに生のデータから直接データ読み込みを行っているので、動作がとても不安定です。マシンパワーがないと止まるかも。ページエラーが起きたら、更新ボタン押せば直ると思います。

http://www.moegi.waseda.jp/yasu-you/InfoSearch/Tango.html

2008-12-03

WAK DataBase

思わず連続投稿してしまいました。

というのも、約10ヶ月前に制作したWAK DBが、友達のデザインによってとてもかっこよくなって帰ってきたからです。あ~、なんともうれしい限りです。

リリースはまだですが、一応制作者だしちょっとぐらいフライングして公開しても大丈夫だろう、多分。 ※ 名前の表示箇所は加工してあります。




メニュー画面


サンプルデータ表示画面



検索画面(鳳凰三山で検索)


検索結果表示画面(鳳凰三山がちゃんと出てます)



最新の山行記録を一覧表示

EyeBot




前回に引き続き、画像処理のお話。


今日、ようやくEyeBotがパイロンを回ってくれました。 最初は、取得した画像に雑音がかなり入っていて、うまく画像処理できなかったのですが、縮小処理を施したら、誤作動を起こす確率が大幅に下がりました。


当初は精度よりも処理速度を重視したプログラムを書いていたけど、精度高い方がやっぱいいね。画像処理の速度が遅くなるから、進むスピードは多少遅くなるけど、まずなにより、誤作動を起こよりずっとストレスが少なくて済む。


画像処理プログラムを書いていく方針としては、まずは精度を求める。次に、速度を求める。っていう方針が良かったのかも。