PyCon2007/20070225
PyCon2007 >> 2007/2/25
Wonderful World of (Tosca) Widgets on the Web
1200~。
A "widget" is a bit of Python that encapsulates HTML, Javascript and CSS.
TurboGears?は2006/2からToscaWidgets?を同梱している。
文字修飾付きのテキストエリアも簡単。
from toscawidgets.widgets.tinymce import *
mce = TinyMCE("mytextarea")
mce.javascript[0].render()
Ajax Widgets
rating widget
easy_install twRating
Widgetを新たに作ることもできる。
ToscaWidgets? Browser
easy_install ToscaWidgets or http://toscawidgets.org/
Write Less Code with XRC for wxPython
1125~。
Why wxPython?
- Most capable Python GUI framework
- Cross-platform
- GPL
- Mature, widely used
Layout in wxPython?
- いろんなアプローチがあるが…
- Ignore previous bullet point.
XRC is better because
- 見た目とロジックの分離
- ...
XRCとは・・・
- XMLでできてる。
- Part of wxWidgets, the "guts" of wxPython
XRCファイルをどうやって書く?
- XRCed -- wxPythonに付属
- wxFormBuilder
- wxSmith
- wxGlade
- VisualWx?
- wxDesigner
- DialogBlocks?
XRCed and wxPython 2.8.1.1
- Get XRCed 0.1.8.1, not in wxPython
- sf.netから持っててね。
What does'nt XRC do?
- wx.Grid
- Custom controls
- Dyanmically changing contol
Testable network programming via the Network Gateway Interface
1050~。
Zopeの人
- Sockets considered harmful
- テストのときソケットを作ってしまう。
- Not deterministic
- Threads and Processes in Tests
- Zope Enterprise Objects
- Asyncore based
- テストが大変。テストを書くのも大変。
"Network Gateway Interface"
- テストのしやすさを考えて設計した
- アプリの実装とソケットを分離。アプリの実装ではソケットを使わない。
- イベントベース
- Should have used twisted.
- 「テストの時にソケットを使わない」というアイデア
zc.ngi.testing
「アダプタ」の概念を導入。
- zc.ngi.adapters.Lines
- zc.ngi.adapters.Sized
ハンドラはスレッドセーフである必要はない。
Event-based APIは面倒なときもある。-- zc.ngi.blocking provides a file-like API.
"I developed NGI under the mistaken impression that Twisted wouldn't suport this style of programming"
- 1.0 released shortly before PyCon. This will likely be the last release.
- I will almost certainly switch to Twisted.
あわわ。こんな結論? いずれにしても、「ソケットを使わなければ、ネットワークアプリのテストが楽になる」と。
Keynote: Computer Literacy
by Mr. Robert M. Lefkowitz
0900~
ううう。Brianの言うとおり、話が難しい人だ…。 いきなり、トーマス・ジェファーソンの言葉の引用から始まる。 お芝居のような抑揚でしゃべる人だ。
CP4E -- Computer Programming for Education
Free Software
- ソースの有無なんて、読める人だけに意味がある。
- 読めるのは人口の2%だけだ。
Why Johnny can't code. http://www.salon.com/tech/feature/2006/09/14/basic/index_np.html
いろんな書籍の例を挙げながら:
- プログラミングは、単なるコンピュータへの指示ではなく、アイデアや考えの発露である。
- Rhetoric=Programming is the art of communicating through symbols ideas about reality.
- Computer literacy generally refers to the ability to use applications rather than to program.
IRCでの評判は総じて高いようだ。
If everyone had to read and study the source code of a (set of) program(s) in high school, which one would you pick?
Moshe Zadke -- Writing a PEP for something you have implemented is just as hard as writing a PEP for something you haven't implemented.
What would it take to design a programming language that would be expressive enough to communicate through symbols ideas about reality.
Literary Work -- Why is all the code for an application not in one file?
Programing as Rhetoric -- プログラミングは作文だ。
Rhetoric Application Architecture
- introduction
- background
- proof
- refutation
- conclusion
In the beginning was a command line. -- Neal Stephanson
Dijkstra -- APL is a mistake, carried through to perfection. It is the language of the future for the programming techniques of the past.
How do you read code out loud?
