2014-01-01から1年間の記事一覧

ラジオボタンの使い方

下図のように、画面上にラジオボタンをDesignerで配置する。ラジオボタンに関する処理を勉強するため、数字を入力して掛算をするサンプルを作成してみた。 ▲Designerで画面のデザインを行うアプリとして動かすために、実際の処理を行うソースは以下のように…

Qt DesignerでMatplotlibのウィジェットを配置したGUI画面を作成

はじめに Qtで作成したGUI画面上で、Matplotlibで描いたグラフを描画することはできた。 しかしその場合にQt Designerは使用していなかった。画面デザインにはQt Designerを使うことが不可欠なので、Qt Designerを使う場合にグラフ画面をどのように埋め込む…

MatplotlibをQtの画面で使う

Qtで作るGUI画面に、Matplotlibで描くグラフを埋め込む。 その方法の一例を以下に示す。ここではQt Designerは使わず、ただ画面に表示させるのみ。 import sys from PyQt4 import QtGui import numpy as np from matplotlib.figure import Figure from matpl…

Qt Designerの使い方に慣れる

「Line Edit」と「Push Button」2つを適当に配置する。ボタンそれぞれのプロパティの「text」を書き換えるとボタンに表示される文字が変わる。ここでは「Clear」と「Close」に変更した。 ボタンを押したときにどこで何が起こるか、ということを定義しなけれ…

タイマーで動いているように見せる

昨日の円の描画にタイマーを付けてアニメーションにする。少しちらつくが、これで小さい円が大きな円の周りを回転しているように見える。コードは以下の通り。 import math import clr clr.AddReference("System.Windows.Forms") clr.AddReference("System.D…

色に透明度を指定する

透明度を指定した色で円を塗りつぶす。コードは下の通り。 import math import clr clr.AddReference("System.Windows.Forms") clr.AddReference("System.Drawing") from System.Windows.Forms import Application, Form from System.Drawing import Size, C…

マウスでクリックした位置に円を描画する

マウスでクリックした位置に円を描画するプログラムは以下の通り。クリックした座標をすべて記録しておく。 import clr clr.AddReference("System.Windows.Forms") clr.AddReference("System.Drawing") from System.Windows.Forms import Application, Form …

マウスでクリックした点を結ぶ線を描く

画面上でのマウスをクリックする。それらの点を結ぶ線を描くIronPythonプログラムは以下の通り。 import clr clr.AddReference("System.Windows.Forms") clr.AddReference("System.Drawing") from System.Windows.Forms import Application, Form from Syste…

マウスで画面をクリックしたときの処理

マウスでのクリック時のイベントをどう定義したらよいか。 GUI画面をクリックしたときに、Do_Somethingで定義した処理を行う場合のコードを以下に書く。本当は、クリックしたところに円を描くようにしたいのだが、そこまでまだ到達できない。 import System.…

問合せする(社内用)

I need the answer to a question that I'm sure the customer will ask. I need some information that I'm sure our clients will want to know. It would be very helpful if you could reply as soon as possible. It would be very helpful to have the…

問合せに返信する

If our products meet your specifications, we would be happy to send you an estimate.(製品が仕様に合うようでしたら、喜んで見積りをお送りいたします) Please feel free to e-mail me anytime. (いつでもお気軽にメールください) If there are any q…

問合せをする

Could you please provide me with... ? (〜についてお知らせいただけますか) According to the information I received, ...(私の得た情報によると...) According to your e-mail of October 13, ...(10月13日付けでいただいたメールによると) 「現在」…

PyQtを使い始める

Qt Designerによる画面デザイン ウィジェットを適当に並べる。使い方はVisualStudioとかとほぼ同じか。完了後、uiファイルとして保存する。 uiファイルをpyファイルへ変換 バッチファイルpyuic4.batを用いる。自分の場合、C:\Python27\Lib\site-packages\PyQ…

pyInstallerの使用方法

wxPythonとMatplotlibで作ったスクリプトを、py2exeでバイナリ化しようとしたら久しぶりなので設定を忘れてしまい、どうにもこうにもできなかったので、あきらめてpyInstallerを使うことにした。参照:http://retrofocus28.blogspot.jp/2013/10/pyinstallere…

自分の都合でお願いする

I have not managed to read your report. (まだレポートを読んでいません) I was hoping to ask you a few questions. (できましたら質問したいのですが) I was hoping to change the appointment to Thursday at the same time. For reasons beyond my c…

お願いする表現

We would like a discount. (値引きをお願いします) I would like you to consider this matter. (この件をご検討いただきたく) I would appreciate your suggestions. (ご提案いただけますと幸いです)

空リストの表現

> (define empty '()) empty> (display empty) () >

手続きlast-pairの実装

与えられた(空でない)リストの最後の要素だけからなるリストを返す手続きを定義する定義例 (define (last-pair items) (if (= (length items) 2) (cdr items) (last-pair (cdr items)) )) 実行例 > (define a (list 23 72 139 32 88)) a> (display a) (23 7…

リストのn番目の要素を返す手続きlist-refの実装

cdrダウンすることで実現できる (define (list-ref items n) (if (= n 0) (car items) (list-ref (cdr items) (- n 1)) ) )

lengthの別の実装

ちょっと回りくどい (define (length items) (define (length-iter a count) (if (null? a) count (length-iter (cdr a) (+ 1 count)))) (length-iter items 0))

リストの個数を返す手続きlengthの実装

リストをcdrダウンしてカウントする。直感的にわかりづらいが慣れるしかない。 (define (length items) (if (null? items) 0 (+ 1 (length (cdr items))) ) ) 実行例 > (define odds (list 1 3 5 7)) > (length odds) 4

リストの中身を表示する

forループの代わりに再帰で書くのがScheme。なかなか慣れない。 (define (show items) (if (not (null? items)) (begin (display (car items)) (show (cdr items)) ) ) ) 実行結果 > (display exp-list) (item:1 item:2)> (show exp-list) item:1item:2#f

申し込む

I would like to stop by your office to discuss. I would like to ask for a room reservation. I would appreciate receiving your help. I would appreciate getting some feedback from you.

情報を伝える

Please be advised that our company address has changed. We would like to advise you that your order has been shipped.

催促の表現

Please inform me of the situation by return e-mail. Please inform me of the details by return e-mail. Please let me know the shipping date. Please notify us if there are any problems.

断りの表現

Unfortunately, I will.. and will be unable to .... (残念ながら...なので、...できない) I regret that I will have to cancel the appointment.

お祝いの表現

Congratulations on your promotion. Congratulations on a job well done. Please accept my best wishes on your second anniversary. Please accept my sincere appreciation for your cooperation. (ご協力に心から感謝いたします)

メールに添付するときの表現(2)

Below is the agenda for the next meeting.(以下は次の会議の議題です) I'm writing to remind you that we have a meeting next week. (リマインドです) I'd like to inform you of the details...(詳細に関してお知らせします) I'm attaching the minu…

メールに添付するときの表現

Here is the agenda for monthly meeting. (月次会議の議題をお送りします) Here is the estimate. (見積りをお送りします) Here is the list of our new products. (新製品のリストをお送りします) Please note that (〜をご確認ください) Please note t…

ファイルへの書出し

数字をファイルに書き出す場合の例 > (define port (open-output-file "test.output")) port> (display port) #[port 0x1174bee0] > (define num 10) num > (write num port) ()> (close-output-port port) #f > 唯一の解説ページ:Scheme 入門 9. 入出力